LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why do my scripts stay in memory? (https://www.linuxquestions.org/questions/linux-software-2/why-do-my-scripts-stay-in-memory-524958/)

darthfoolish 02-02-2007 06:54 AM

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?

unSpawn 02-02-2007 07:33 AM

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.

rufius 02-02-2007 09:50 AM

Are you sure you setup the crontab properly?

sundialsvcs 02-04-2007 09:17 PM

What is the status of the various instances? Are they "defunct?"

darthfoolish 02-05-2007 01:49 AM

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?


All times are GMT -5. The time now is 05:15 AM.