By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,053 Members | 922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,053 IT Pros & Developers. It's quick & easy.

Unable to consume Heap reserved memory

P: n/a


Hi ,
A Windows form application which interacting with the unmanaged C++
codes . In unmanaged c++ code we allocate around 130MB on the heap for
annalysing high resolution images .

Earlier during the processing ee do lot of process on the image and the
memory reaches high at one point of time to 1.2GB , after that we clear
all the memory being used so the memory in the task manager comes to
really low.
Also I am calling CompactHeap function in the c++ to get contigous
memory space.

Then when we read the processed high resolution image (130MB ) it is
going to out of memory exception . At this point I run memory analyser
and analysed the process memory , the reserved memory in the process is
good enough and the free memory in the process is really low . I am
wondering why the system is not taking the memory from the reserved
memory space.

Regards
Aravind.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Maybe some code that shows how you do the managed/unmanaged code interaction
would help diagnose the problem.

Hector

"Aravindakumar Venugopalan" <ar*************@gmail.com> wrote in message
news:O6**************@TK2MSFTNGP10.phx.gbl...


Hi ,
A Windows form application which interacting with the unmanaged C++
codes . In unmanaged c++ code we allocate around 130MB on the heap for
annalysing high resolution images .

Earlier during the processing ee do lot of process on the image and the
memory reaches high at one point of time to 1.2GB , after that we clear
all the memory being used so the memory in the task manager comes to
really low.
Also I am calling CompactHeap function in the c++ to get contigous
memory space.

Then when we read the processed high resolution image (130MB ) it is
going to out of memory exception . At this point I run memory analyser
and analysed the process memory , the reserved memory in the process is
good enough and the free memory in the process is really low . I am
wondering why the system is not taking the memory from the reserved
memory space.

Regards
Aravind.
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

P: n/a
Thanks for your reply,

The unmanaged / managed is through usual interop servies ,
Actually the problem is not occuring when I donot process the image that
fills and after clears the memory . Once I process the image that
consumes and clears the memory , disposed memory goes to the reserved
memory , after that if i allocate memory on the heap of 130MB for the
image it leads to out of memory exception .

I am wondering how to clear the reserved memory and make it as free
memory that the process can use for alloting when i say CALLOC ( 130 MB
), will the heap manager takes care of that.

Regards
Aravind.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

P: n/a
Mind to tell us what CompactHeap really is?
I'm also not sure what you mean with this ...
after that we clear
all the memory being used so the memory in the task manager comes to
really low.
What exactly do you mean with "clear the memory" and what exactly you are
looking at in taskman?
I would suggest you take a look at the memory consumption using perfmon,
herewith you can inspect managed heap (CLR memory counters) and non managed
heap memory (process counters).
I would also suggest you read about memory management and GC heap management
in windows application.

Willy.

"Aravindakumar Venugopalan" <ar*************@gmail.com> wrote in message
news:O6**************@TK2MSFTNGP10.phx.gbl...

Hi ,
A Windows form application which interacting with the unmanaged C++
codes . In unmanaged c++ code we allocate around 130MB on the heap for
annalysing high resolution images .

Earlier during the processing ee do lot of process on the image and the
memory reaches high at one point of time to 1.2GB , after that we clear
all the memory being used so the memory in the task manager comes to
really low.
Also I am calling CompactHeap function in the c++ to get contigous
memory space.

Then when we read the processed high resolution image (130MB ) it is
going to out of memory exception . At this point I run memory analyser
and analysed the process memory , the reserved memory in the process is
good enough and the free memory in the process is really low . I am
wondering why the system is not taking the memory from the reserved
memory space.

Regards
Aravind.
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.