On Friday, 30 November 2012 at 23:35:16 UTC, Ali Çehreli wrote:
On 11/30/2012 03:21 PM, js.mdnq wrote:
> I noticed that in both x64 and x86 builds the GC seems to get
> exponentially slower as the objects are allocated.
[...]
> Since the sample code
that you have forgotten to show ;)
> allocates objects sequentially without any
> deallocation it seems there is a huge "bug" in the GC code.
Possible.
> Can we expect improvements of the GC at in time in the near
> future(months, not years)?
Yes. There is already a precise GC implementation for D, which
should be available with dmd as early as 2.062.
Ali
Cool. The code is basically taken off the first link. I modified
it a little but the original code should work. All I did was
increase the size of objects that are being allocated. I was
mainly using GDC x64 though.
What I did was run the code and watch the memory usage as it ran.
I noticed that it was getting slower and slower. Now, one could
expect such if the main memory was fragmented and GDC could not
allocate contiguous blocks, but I do not think that was the case
and it happens for much smaller amounts of memory.
My guess, and just a guess, is that it does not reserve large
enough blocks of memory once it is initial memory block is full.