Re: GC performance - GC fragility



> You are testing only the raw speed of allocating and freeing memory
> and without the cost of accessing elements in the allocated memory
> continuously, where GC is moving the memory while the code is running
> and WIN32 is not moving it.

Yes, but when Win32 is not moving the memory (it's always accessing the same location as you said) and GC is permanently moving ahead and freeing the memory, why has the Win32 heap been that slow - it has been only a simple "alloc 20 bytes" call to the memory manager ? It hasn't to search for an empty block, it should be nearly as fast as the GC one ?

I have allocated about 40 MB and the managed application has been using 5 MB system memory - so the 5 MB must have been touched multiple times and regarding your argumentation it must have been slower - or let's say at least shouldn't be (significantly) faster.
One argument could be that memory linearly can be accessed faster, than by random access. But that would speak for GC.


Also I don't think that the native heap has a much better cache locality. Think of a native heap which has

1000 entries of the type:

[60 bytes free] [40 bytes allocated] [60 bytes free] [40 bytes.....]

{ it's called heap fragmentation }

What will happen if the applications now wants to allocate 80 bytes ?
Every entry has to be checked and touched. Not quite local (for this example).


There are many other reasons why managed applications are slower than native ones. There are many reasons why optimized assembly is still much faster than compiled native code.

And I agree with you that cache locality and memory usage has a significant influence on the performance of applications.

But I don't think the GC to have generally a negative impact on the performance of managed applications.


Andre
.



Relevant Pages

  • Re: [Announce]: Target_Core_Mod/ConfigFS and LIO-Target v3.0 work
    ... allocations would help the performance of a storage target. ... A single codepath memory allocating *AND* mapping for: ... Allocating multiple contigious struct page from the memory allocator ... I never claimed that RDMA is only possible from user space -- that was ...
    (Linux-Kernel)
  • Re: Forcing a Large Object Heap allocation.
    ... you should be passing the recommended 60% memory limit. ... that point and you should be experiencing an unstable app IMO. ... > compacts the heap. ... > objects in the regular heap causes poorer performance than allocating many ...
    (microsoft.public.dotnet.framework.performance)
  • Re: [00/41] Large Blocksize Support V7 (adds memmap support)
    ... some memory will be wasted. ... blocks with slab pages can be targetted and cleared if necessary. ... Allocating userpages from slab in 4k chunks with a 64k PAGE_SIZE is ... it remains a possibility to make the kernel more generic. ...
    (Linux-Kernel)
  • Re: ORACLE 9i - memory usage
    ... Oracle allocates 13GB (which is the total size of your SGA) at startup ... within physical memory. ... Can I guess it is actually allocating 13Gb of memory? ...
    (comp.databases.oracle.server)
  • Re: abnormal OOM killer message
    ... But I think it seems not to relate with stale data problem in compcache. ... My question was why last chance to allocate memory was failed. ... I think that last allocating memory should have succeeded. ...
    (Linux-Kernel)