Re: Memory leak
From: Sherif ElMetainy (elmeteny.NOSPAM_at_wayout.net.NOSPAM)
Date: 01/09/05
- Next message: MrNobody: "strange problem adding child node to a parent node"
- Previous message: MajorTom: "Re: Can't find dll"
- In reply to: Benoit Vreuninckx: "Re: Memory leak"
- Next in thread: Mihai Diac: "Re: Memory leak"
- Reply: Mihai Diac: "Re: Memory leak"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 9 Jan 2005 19:54:36 +0200
Hello
You are right, but in your test you are allocating a lot of large arrays
which goes to the the large object heap. Allocating a lot of large objects
causes a lot of generation 2 collections which hurts perfomance badly.
Typically you should design your application so that large objects
allocation are not frequent and when they do happen the large objects should
not be short lived.
Best regards,
Sherif
> Hi,
>
> my story, last year, I did a memory-stress-test by simply creating a
> bunch of small objects (8 bytes in size, that is, an integer and the
> implicit vmt pointer) and storing them in an array (500000 elements).
> When the array is full, a new array is created and populated and so on
> and so on. This went well, up until a certain memory load. Further
> allocating, beyond this point, began taking more and more time. You
> could also notice lots of harddisk activity, which must be swap activity.
> My conclusion: everything goes well, when there's enough free physical
> memory. No (or less) swapping is needed, the garbage collector does not
> run much often and allocation is pretty fast. But when free memory gets
> very rare (the OS already is swapping things back and forth) the GC is
> run more often. When the GC runs, it scans whatever it thinks is
> necessary, causing even more page faults, causing the application to
> choke. This does not happen in applications without a garbage collector
> (pretty much every application before the .net/java/... period). With
> 'native' applications, pages that are swapped out of memory stay on disk
> until the application references them. There's no garbage collector
> that needs to scan (read: reload from swapfile) the *entire* memory
> space for unreferenced objects.
> So, your application scales with the amount of free physical memory.
> (IMHO)
>
> Cheers,
> Benoit.
>
- Next message: MrNobody: "strange problem adding child node to a parent node"
- Previous message: MajorTom: "Re: Can't find dll"
- In reply to: Benoit Vreuninckx: "Re: Memory leak"
- Next in thread: Mihai Diac: "Re: Memory leak"
- Reply: Mihai Diac: "Re: Memory leak"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|