all groups > dotnet performance > july 2004 >
You're in the

dotnet performance

group:

Forcing a Large Object Heap allocation.


Forcing a Large Object Heap allocation. Frank
7/31/2004 9:42:40 PM
dotnet performance:
Does anyone know if it is possible to force a small object to be allocated
on the Large Object Heap (LOH)?

Thanks,
Frank

Re: Forcing a Large Object Heap allocation. Frank
8/1/2004 10:08:16 AM
Alvin,

I am working on an app that MUST be responsive at all times. Our application
has a very large managed memory footprint (> 1GB of small objects). We are
seeing that our app hangs for a couple of seconds when the garbage collector
compacts the heap. Since our app must remain responsive we would rather take
the hit of allocating on the LOH and avoid the "compacting" phase all
together. The LOH has been described as being more similar to the C++ heap,
which is what we want. However, we want to try to avoid making calls into
unmanaged code for all our allocations and deallocations. Pinning many small
objects in the regular heap causes poorer performance than allocating many
large objects in the LOH.

Is there any way to avoid the ~2 second pause caused by the compacting
process?

Thanks,

Frank

[quoted text, click to view]

Re: Forcing a Large Object Heap allocation. Alvin Bruney [MVP]
8/1/2004 10:54:11 AM
What's the reason for this? Large objects need to live on the large object
heap, small objects don't need to.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
[quoted text, click to view]

Re: Forcing a Large Object Heap allocation. Alvin Bruney [MVP]
8/1/2004 11:13:42 PM
I'm confused by a couple of things in your response.

[quoted text, click to view]
How much memory is available on the machine? Bear in mind that .net
allocates 2gigs of address space max. At that rate, with other apps running
on the box, you should be passing the recommended 60% memory limit. Pass
that point and you should be experiencing an unstable app IMO.

We are
[quoted text, click to view]
GC works by copying live objects, with such extreme memory pressure as your
app is placing on the system, 2 seconds is reasonable.

[quoted text, click to view]
What benefit do you see by pinning managed objects?

[quoted text, click to view]

I'd like to know why the app is so memory intensive before dishing out
advice. Maybe you can go into some more detail about the application and the
footprint size. I've never really seen such a demanding memory requirement
for run of the mill type applications.


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
[quoted text, click to view]

Re: Forcing a Large Object Heap allocation. David Notario [MSFT]
8/3/2004 12:42:12 AM
There is currently not a way of doing that.


--
David Notario
Software Design Engineer, CLR JIT Compiler
http://devdiary.xplsv.com



[quoted text, click to view]

Re: Forcing a Large Object Heap allocation. Alvin Bruney [MVP]
8/3/2004 2:12:30 PM
David,
is the VLO bug fixed in 1.1?
VLO Bug: when large chunks of data are allocated, the framework never gives
back the memory.
http://support.microsoft.com/default.aspx?scid=kb;en-us;322975
this also happens outside of remoting as well. any updates?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
[quoted text, click to view]

AddThis Social Bookmark Button