Where is my memory?

via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 22 02:42:39 PDT 2015


Hi!
I'm working on a Big Data project, where a huge amount of RAM is 
needed. Using D I've run into a - let's called it - memory leak. 
I tested this with following code:

	foreach(i; 0..1000) {
		int[] ints;
		foreach(j; 0..1000) {
			ints ~= uniform(0, 100);
		}
	}

Without the first foreach this code use only 220KB,
with the first foreach this code needs 2,5MB.
(220KB x 1000 is something around 2,5MB).

But why is GC (Garbage Collector) not running? Following the 
explanations in http://wiki.dlang.org/Memory_Management memory 
usage should be something around  220KB.

I used GC.minimize, slow down the loop, replaced 
uniform...doesn't work.
(By the way: After a while my LINUX server killed my big data 
project because running out of RAM & SWAP space)


Thanks for your advice,
Ozan


More information about the Digitalmars-d mailing list