This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory Leakage

Hi,
we are using 80515 core. Here in the code, memory are allocated dynamically in different files using standard library function "calloc". The code is very large in size..almost 58KB & it contains more than 60 source files. Total 5 people are involved in development. Now my problem is to find out the memory which is allocated but not made free in order to avoid memory leakage. Anybody can help me how to findout the unnecessary allocated memory. Here, i am sure that dynamically allocated memory needs not to be there for the life time in the code. Depending on some conditions, we have to deallocate, but unfortunately if it was not deallocated.
Also tell me how to know the size of Heap ?

Thanks in advance

Parents
  • Using linked-lists does not in any way require the use of dynamic allocation!

    Surely, you must know the amount of space available to these lists at compile time?
    So why not just create the appopriate-sized, statically-allocated list at compile time?
    You then just link items into a "free" or a "used" list at runtime as required.

    "i want to know the size of heap allocated for my program"

    It's your program - you determine this at compile time!

    "i want to know ... free space available in Heap"

    Then you need to provide suitable functions as part of your memory-management implementation.
    Yes - more overhead!

Reply
  • Using linked-lists does not in any way require the use of dynamic allocation!

    Surely, you must know the amount of space available to these lists at compile time?
    So why not just create the appopriate-sized, statically-allocated list at compile time?
    You then just link items into a "free" or a "used" list at runtime as required.

    "i want to know the size of heap allocated for my program"

    It's your program - you determine this at compile time!

    "i want to know ... free space available in Heap"

    Then you need to provide suitable functions as part of your memory-management implementation.
    Yes - more overhead!

Children