LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 02-02-2007, 07:54 AM   #1
darthfoolish
Member
 
Registered: May 2006
Posts: 47

Rep: Reputation: 15
Why do my scripts stay in memory?


I have a few self written scripts which I run as cron jobs. After my system has been running for a while, it tends to slow down a bit. When I run ps -e I notice that there are numerous copies of my scripts running in memory.

Most of my scripts are just small bash ones, but i have a largish python one which also stays in memory. When I run top after the system has been running for a while, most of the top 10 processes are pythons.

When i run the python script myself, I have sometimes seen it hanging and I assume that this is why it stays in memory. However, I have never seen any of my shell scripts hanging so i don't know what's causing them to stay in memory.

I'm seeking a solution for both, but I suspect that the python one will come down to me coding better error trapping.

Can anyone help?
 
Old 02-02-2007, 08:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,709
Blog Entries: 54

Rep: Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965Reputation: 2965
However, I have never seen any of my shell scripts hanging so i don't know what's causing them to stay in memory.
Wrt shell exit-on-err and debugmode are your friend, then. Maximise it and "set -evx" below the shebang line, then kill after it's been running for a preposterous amount of time. Since it's cronjobbed, and if you properly set your crontab MAILTO var, you should have some results in the mail....


darthfoolish
Nice handle.
Reminds me I should play UT FFA again RSN.
Always fun playing against them darth.* folks.
 
Old 02-02-2007, 10:50 AM   #3
rufius
Member
 
Registered: Oct 2002
Location: Miami, FL
Distribution: Ubuntu
Posts: 184

Rep: Reputation: 30
Are you sure you setup the crontab properly?
 
Old 02-04-2007, 10:17 PM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
What is the status of the various instances? Are they "defunct?"
 
Old 02-05-2007, 02:49 AM   #5
darthfoolish
Member
 
Registered: May 2006
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by sundialsvcs
What is the status of the various instances? Are they "defunct?"
When doing ps -e, I don't see anything that says defunct. Is there a switch to show status?

Rufius, I'm not sure of anything.

unSpawn, I tried what you said, but I don't see anything in my mail. I didn't previously have the MAILTO var set, but now I have it set to mythtv. (The first line in my crontab reads MAILTO=mythtv)

The system generated mail isn't something I often look at. I was surprised to see that the last mail I got was on Wed Aug 30 2006, on both root and mythtv accounts

I built the system last June, and have used it extensively ever since. Does it look like I did something to break the mail daemon on that date? What is the name of the stock mail daemon on Fedora Core 4? I guessed at maild or mailerd, but none of those are running.

I looked at /var/log/yum.log, and on that day I erased mythplugins, mythflix and mythphone and installed amarok.


edit: I see sendmail is running. Is that what is used?

Last edited by darthfoolish; 02-05-2007 at 03:24 AM.
 
  


Reply

Tags
as, been, bit, copies, cron, few, has, jobs, memory, ps, running, scripts, self, system, while


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 01:10 PM
Should I stay, or should I go? /home/kyle General 23 03-14-2004 02:36 PM
How to make modules to stay in the memory till syst shutdown?? paonethestar Linux - Software 2 10-29-2003 10:31 AM
X won't stay up tlw1linux Mandriva 19 10-07-2003 04:50 PM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 05:48 PM


All times are GMT -5. The time now is 12:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration