The problem is that the LOH is not designed to handle lots of small objects.
So, you may run into more severe problems (like fragmentation problems) if
you use the LOH for your small object allocations. If the real time
constraints on your app are so severe that you cannot afford the compaction
phase, maybe this means that you app is not suitable for a managed
environment, or that you must manage your memory differently (like
allocating big arrays of structs instead of allocating objects
individually).
BTW our app also has a very large memory footprint (between 500MB and 1GB)
and we see the compaction hit, but we can live with it (this is a web
server, so the user can take a 1-2 second hit once in while (every 10
minutes or less often, depending on the load).
Bruno.
"Frank" <google@xemaps.com> a écrit dans le message de
news:10gq8o3kbhv6fb@corp.supernews.com...
[quoted text, click to view] > Bruno,
>
> 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 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
>
> "Bruno Jouhier [MVP]" <bjouhier@club-internet.fr> wrote in message
> news:u3Fclh7dEHA.1000@TK2MSFTNGP12.phx.gbl...
> > I don't think that you have this level of control. I don't see any
reason
> > why this would be useful either. The memory manager must be properly
> > encapsulated and should not expose this level of detail. Why do you need
> > this?
> >
> > Bruno.
> >
> > De: "Frank" <google@xemaps.com>
> > Objet: Forcing a Large Object Heap allocation
> > Date: Sunday, August 01, 2004 6:44 AM
> >
> > Does anyone know if it is possible to force a small object to be
allocated
> > on the Large Object Heap (LOH)?
> >
> > Thanks,
> > Frank
> >
> >
> >
>
>