M
Martin Plechsmid
Hello.
When trying to allocate a huge amount of memory, our production system
throws OutOfMemoryException. Well, there is not enough memory available,
that's the reason. But what I don't understand is the folowing:
Using System.Diagnostics.PerformanceCounter("Memory", "Available MBytes") we
see that the system still has over 600 MB available. However, when the
system tries to allocate about 300 MB byte[], it gets OutOfMemoryException.
I would expect, that 700MB of available memory means that the system is able
to allocate almost all of these 700 MB in one continuous block. And if it is
not able right now, it will be able after garbage collection finishes.
It seems to me that the garbage collector needs twice as much memory for its
work than it allows to allocate. Is it so?
Thank you,
Martin.
When trying to allocate a huge amount of memory, our production system
throws OutOfMemoryException. Well, there is not enough memory available,
that's the reason. But what I don't understand is the folowing:
Using System.Diagnostics.PerformanceCounter("Memory", "Available MBytes") we
see that the system still has over 600 MB available. However, when the
system tries to allocate about 300 MB byte[], it gets OutOfMemoryException.
I would expect, that 700MB of available memory means that the system is able
to allocate almost all of these 700 MB in one continuous block. And if it is
not able right now, it will be able after garbage collection finishes.
It seems to me that the garbage collector needs twice as much memory for its
work than it allows to allocate. Is it so?
Thank you,
Martin.