question about memory shortage

C

Chang Byun

I have question about memory allocation.

I have a trouble when I run a C program.
My C program has several big double pointer(** var) variables to
structure data like 4 by 5000000.
It is supposed to calculate those varibles with different parameters
repeatedly with same size of variables.
When it is running, the first several run is fine
But it uses more and more memory, is used up all the main memory
and swap memory and is stop.
I am pretty sure that I free every variable for each run using free().

My questions are,

1. if the process needs more memory space even though every
variables are released with free().
2. How can I check if there is memory leak?
3. Would it be better if big variables breaks down to smaller size
variables.

Any seggestions and helps would be very appreciated.

Thanks,

Chang Byun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top