sv_vcatpvfn hogs memory [Patch included]
This is a bug report for perl from neeri@iis.ee.ethz.ch
For each %x element to be inserted, sv_vcatpvfn grows the sv to SvLEN +
the size of the element. I strongly suspect that this is a typo, as this
totally defeats the purpose of the sv_grow buffering and leads to huge
sv's with most memory unallocated.
I have included a patch that I believe to be correct; I am not 100% sure
whether the "+1" is needed, too, but I suspect that it is.
As an aside, from my past two bug reports, I'm starting to believe that
it might be worthwhile to add monitoring of memory consumption to the
execution of the perl test suite: I noticed the bug when the execution of
the seemingly innocuous comp/colon.t failed with an out of memory error
attempting to allocate a huge (>10M) sv. I assume that the execution of
comp/colon.t on an UNIX system would consume just as much memory, but is
not usually noticed because a VM system can easily absorb this. Adding
memory consumption figures to the test reports, if this is possible to do
in a portable way, might uncover more bugs like this.
p5p-msgid:
199706211521.RAA12778@solar.ethz.ch