Hi again,
Yes, some of the functions are using recursion. This is not the only memory allocation and this one uses a constant memory over time, but some other memory allocations vary over time....
User Profile
Collapse
-
I have tried malloc from stdlib before, eventhough I use the malloc implementation of the software now, but there is no difference when I convert them to malloc of stdlib.
by the way, I counted the allocation and free calls and they were both equal....Leave a comment:
-
Thanks for the tips. The program returns a message which I think was generated by the software:
Allocation of memory failed;...Leave a comment:
-
oh, I don't know. I am using a c/c++ based software for simulating networks. The software is installed on windows xp, and I do not know how to trace memory leaks....Leave a comment:
-
here is a copy paste of some part of my code
int *D;
void init()
{
int sizealloc, sch_size,node_s ize, i;
sizealloc = (2*nodes+2)*(si zeof(int));
node_size = nodes*nodes *(sizeof(int));
D = (int *) malloc(node_siz e);
....
}...Leave a comment:
-
I use gcc. There was a mistake in that example. actually the line D= (int *) malloc(size); is inside a function called init(). the rest are ok. I don't know why my program eats up the memory. whether or not I free the memory it uses all of it very fast....Leave a comment:
-
Sorry,
D= (int *) malloc(size); is in a function called init(). But the pointer declaration "int *D" is not in a fucntion. The program works, but it stops sooner than I need to....Leave a comment:
-
malloc
Hello,
I have written a long program with c, and am using dynamic memory allocation. This program is supposed to be run over and over (300 times) for a long simulation. But the program stops after 120 cycles due to memory leackage. I am not very expert in programing but it seems that my free() function does not do anything to my program. One example of how I do memory allocation and free is this:
...Leave a comment:
-
malloc
I have written a long program with c, and am using dynamic memory allocation. This program is supposed to be run over and over (300 times) for a long simulation. But the program stops after 120 cycles due to memory leackage. I am not very expert in programing but it seems that my free() function does not do anything to my program. One example of how I do memory allocation and free is this:
int *D;
D= (int *) malloc(size)....
No activity results to display
Show More
Leave a comment: