The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-29-2003
ramki_rk ramki_rk is offline
Registered User
  
 

Join Date: Jul 2003
Location: india
Posts: 1
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.
  #2 (permalink)  
Old 08-26-2003
andyj andyj is offline
Registered User
  
 

Join Date: Jul 2003
Location: UK
Posts: 27
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.
  #3 (permalink)  
Old 08-27-2003
mbb mbb is offline
Registered User
  
 

Join Date: Aug 2001
Location: UK
Posts: 104
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?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0