Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 11th, 2005, 10:07 AM   #1
shinni
Newbie
 
Join Date: Jan 2005
Posts: 5
Rep Power: 0 shinni is on a distinguished road
Program gets aborted on large input

Hi All,

I am facing problem while i execute one C program on large input files. The program is running correctly, there is no segmentation fault. But after time (around 56-60 sec:- as shown in 'top' command) the program is getting aborted automatically. When i ran the command 'top', i could see that root executes the process kswapd (pid=9) many times till my a.out gets stopped..

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAN
6245 shinni 24 0 284m 170m 2156 R 73.9 68.1 0:57.60 a.out
9 root 15 0 0 0 0 D 0.7 0.0 0:00 .53 kswapd0

I tried several inputs, but when the time is exceeds the above specified threshold, the program gets aborted automatically.. is there any system varibale i can configure so that i can run and check the programs for any period of time I want ? System becomes very slow when i run the program ? Why system kills the process automatically ? I was running the program , using KDE desktop theme and there were no other forground processes. OS is Fedora core 3. RAM is 256 MB. What alternatives I shall try to solve this ?

Is the program is getting aborted because of insufficient swap memory space, what shall i do ?

Please help.

Regards

Shinni
shinni is offline   Reply With Quote
Old Mar 11th, 2005, 11:01 AM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
read the data from disk, and don't read it all into memory at the same time. How large exactly are your input files?
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Mar 12th, 2005, 8:09 AM   #3
shinni
Newbie
 
Join Date: Jan 2005
Posts: 5
Rep Power: 0 shinni is on a distinguished road
Re :Program gets aborted on large input

I tried using the hard limits for stack space ( ulimit -s unlimited) , to get the available stack space ..

From another forum , i got a suggestion to create temporary stack file of some particular size and run the program. But the program was using the memory from default stack space, thought new stack file was created..

i could not attach here the input file i tried .
The input file is not large, but there is lot of recursion using each substring from the input file.

Both the above methods did not work , program is still getting aborted. When I increase stackspace using ulimit , program is running for soem mroe time ..

It was my guess that the program is getting aborted because of in-sufficient memory. It is not showing any segmentation fault , and if the input is given part by part , it is working .

Thank you for time
shinni is offline   Reply With Quote
Old Mar 12th, 2005, 8:26 AM   #4
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
it sounds like you're reading the same data a couple of times filling up your memory, you'd be better off saving the addresses of the data and accessing it from disk as needed.
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC