Memory Leaks

Discuss PocketC for CE (including Desktop Edition)

Postby bstill on Sat Dec 23, 2000 8:54 pm

I am experiencing memory leaks with my application.

I am writing my application to use subroutines that are basically independent of the other subroutines except that certain variables are passed back and forth.

The subroutines that are having a problem seem to be the ones where I am passing parameters. A couple of my subroutines are called many times each second, and it appears as though the program is grabbing between 1k and 4k every second.

Are there any known memory leak issues?
Posts: 10
Joined: Tue Dec 19, 2000 3:01 pm

Postby darwin on Tue Dec 26, 2000 6:57 am

I have a similiar problem.
Kevin suggested to write a function called, mymalloc(int mem). It allocates the memory and returns the point, but it adds the mem-value to a global variable. So you can see your memory increasing.
If you are also freeing memory, you will need a myfree(pointer p) function...

I know that is still very hard to find your leaks. You will have to find out the leaks on your own. Deactivate functions, make sure that you are first freeing pointers inside of allocated memory arrays, so if you know that you won't loose memory.
Write free() functions (point_free(pointer p)), that's only task is to free the allocated memory proberly, etc.

It's not an easy task.

If you have a memory loss, and you don't use malloc(), it's a problem of the runtime engine, and you should contact Kevin.

Posts: 71
Joined: Tue Dec 05, 2000 12:04 pm
Location: Germany

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 1 guest