![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To reduce execution time | Sreejith_VK | Shell Programming and Scripting | 4 | 05-13-2008 02:49 AM |
| Estimated execution time | Sreejith_VK | Shell Programming and Scripting | 4 | 04-16-2008 09:23 AM |
| specifying an execution time | VGR | UNIX for Advanced & Expert Users | 7 | 03-19-2008 05:32 AM |
| script execution time calculation | johnsonbryce | Shell Programming and Scripting | 9 | 02-25-2006 01:33 AM |
| last execution time | cubs0729 | UNIX for Dummies Questions & Answers | 1 | 01-20-2006 08:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|