in reply to Re^5: Out of memory with XML::Parser
in thread Out of memory with XML::Parser

Sorry, I made a mistake - the element it's choking on contains 900 kilobytes of data (I had the tracing statements in the wrong section). Since I know though the size of the undecoded data in advance (it's on of the element's attributes) is there any way I can get Perl to preallocate a scalar to that size + padding for the Base64 encoding? Also, when it's processing the huge file strace shows massive amounts of mremap calls:
mremap(0x40617000, 827392, 827392, MREMAP_MAYMOVE) = 0x40617000 mremap(0x404bd000, 827392, 827392, MREMAP_MAYMOVE) = 0x404bd000 mremap(0x40617000, 827392, 827392, MREMAP_MAYMOVE) = 0x40617000 mremap(0x404bd000, 827392, 827392, MREMAP_MAYMOVE) = 0x404bd000