execution time

hi ,
i ve coded a C program
in that im using malloc dynamically ,
it is being called many times in the program
The program is to simulate jobs in manufacturing system.
the execution time is increasing drastically as the number of jobs are increased.
could any body tel what may be the problem and how to debug the code for memory related operations?

thank you.

Sounds like you forgot to free() the memory after its used - this is a typical problem, theres a finite amount of RAM and every call to malloc uses up a new area, if you dont use free() to '(un) alloc(ate) ' it then what you have is a memory leak, the program will get slower and slower as the disk starts thrashing pages and eventually it will lock up and die.

How are you organising your data? Is it by a linked list, or perhaps an array of pointers?

Sequentially scanning a large array (or linked list) may degrade the performance of your program as the array grows.

Perhaps you need to use a tree structure instead?