Re: How to release heap memory that is marked as 'free'
- From: "Michael Evenson" <mevenson@xxxxxxxxxxxx>
- Date: Thu, 13 Apr 2006 09:29:47 -0400
Ajay,
Actually the memory does still belong to the process, but has been freed.
Apparently Windows does not reclaim the freed memory from the heap until it
is needed. This is all well and good except that , if Windows cannot find a
large enough contiguous block of memory upon a request for allocation, it
prefers to use virtual memory over doing a garbage collection to find more
memory. The freed memory becomes part of my process's 'working set'.
Eventually, my process consumes so much memory in it's working set (which
is marked as free since there is no leak) that all other process running on
the machine have to get their memory from the virtual memory pool.
I remember that there is a way to force Windows to reclaim the freed memory,
but it invovles something to do with forcing the process to swap to disk.
When this happens, all of the memory allocated to the process is garbage
collected and the freed memory is returned to Windows. I just canot remember
how to force the process to swap. I remember having to get the process ID of
the application and doing some system call to force it out of memory (I
think).
Mike
"Ajay Kalra" <ajaykalra@xxxxxxxxx> wrote in message
news:1144934421.595893.228090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
it shows a VERY large amount of memory that is free but has not been
returned to
the operating system.
How do you figure this? That would mean that your process is still
using that memory.
---
Ajay
.
- Follow-Ups:
- Re: How to release heap memory that is marked as 'free'
- From: Joseph M . Newcomer
- Re: How to release heap memory that is marked as 'free'
- From: Tom Serface
- Re: How to release heap memory that is marked as 'free'
- References:
- How to release heap memory that is marked as 'free'
- From: Michael Evenson
- Re: How to release heap memory that is marked as 'free'
- From: Ajay Kalra
- How to release heap memory that is marked as 'free'
- Prev by Date: Re: How to release heap memory that is marked as 'free'
- Next by Date: SDI app: Sending messages to the view
- Previous by thread: Re: How to release heap memory that is marked as 'free'
- Next by thread: Re: How to release heap memory that is marked as 'free'
- Index(es):
Relevant Pages
|
Loading