[REBOL] Re: Severe bug with large sizes of 'mold values in Windows 2000 with Reb
From: nitsch-lists::netcologne::de at: 3-Nov-2001 3:46
RE: [REBOL] Severe bug with large sizes of 'mold values in Windows 2000 with Rebol/View
> I've only just come across this bug and I'm not sure if it's confined to
> Windows 2000 and Rebol/View. I had a large block of 699 objects. Each object
> could be 'save-d in a text file that is 17 Kbytes in size (I found this out
> later on). So the total 'mold-ed value is nearly 12 megabytes in size.
> Rebol/View failed in this task (no error message though), and Windows 2000
> popped up with the error message (IIRC):
> Your virtual memory ... is too small.
> While this ... is being enlarged, allocations will fail.
> I clicked OK and waited, nothing happened. I checked with the task manager
> program and saw that the Rebol.exe process was using nearly 100% processor
> time and consuming around 21Megabytes of memory. Then Rebol would release it
> all to nearly 14 megabytes and ramp up again to 21, much like a sawtooth
> pattern. It did this for around 8 minutes, before I finally stopped Rebol
> with the task manager.
> Unfortunately, I haven't got a test program, as my script created these 699
> objects in a block from a 4 megabyte long BASIC data file.
> When I used a 'foreach and 'save-d the objects individually, everything
> worked fine (with small objects). When I went back to 'save-ing the block,
> the same problem occured.
> I suspect that this problem might occur with any mold value that results in
> output greater than 10 - 12 megabytes, but I haven't confirmed it. It may
> also be a similar problem to the problem that occurs when trying to 'probe
> system from inside Rebol/View.
> I've emailed this to [feedback--rebol--com] as well.
> Anyone got any suggestions?
looks like a bad increasion scheme.
lets say, we have a block/string and this gets to small.
so automatic allocates old size + 1000, copies old stuff,
changes refence and ok. well, if there is a lot to copy,
it will trigger garbage collection.
now it depends: if rebol does it right,
it will allocate old buffer + 100% or that, based on block size.
if it does it wrong, it adds a fixed amount.
lets say we have 10000K and rebol increases with 1K,
it would have to do 10000 copies of some mb, and a gc each time.
that would give this saw-tooth.
with 100% it would go to needed size very quick,
but waste quarter of memory.
i had a similar behavior once when i filled a very large block,
then i checkt size before inserting and reallocated by hand,
and it worked.