Welcome Guest Login Register Member List
ExpressionEngine Forums
Advanced Search
Username: Password:
Remember Me? forgot password?
You are here: Forum Home  >  Usage  >  Troubleshooting  >  Thread
   
 
Memory leaks?
 
TiGGr
Posted: 17 December 2006 10:54 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  2
Joined  2006-11-12

First of all I would like to say I really appreciate Tracks. The ability to use RSS feeds rocks, and I am putting my actions on my desktop with GeekTool. I also use quicksilver to add tasks to tracks via applescripts.

I am running tracks on a local installation under Mac OS Tiger (10.4.8), using Apache 1.3.33, Ruby 1.8.5, Rails 1.1.6 and SQLite 3.1.3. When the computer boots, I usually just have to visit the login page in order for the tracks application to start and my feeds to display on the desktop. If I look in activity monitor, about 4-8 ruby processes are running with each process using 0,5-1% CPU and using not more than 25 MB of memory each.

Now, my computer is an old trustworthy PowerBook 12” with 768 MB of RAM. It has almost become a stationary computer for me and I frequently keep it on during the night. Because of its small resources I keep an eye from time to time on the memory usage and I have noticed something strange.

If the computer has been running for a long time, one or more of the ruby processes is much bigger than the rest. The same CPU usage as the rest but with massive memory usage. This morning, I found one to consume over 300 MB(!) of real memory (not virtual).

To force quit the process in question via activity monitor does not seem to affect the Tracks application
in any way. If it needs to, it will start another process - but this time with small memory usage. I thought that this first had to do with a bug in Ruby so I upgraded to 1.8.5, but the problem still remains. If anyone else see their free memory drying up, try deleting the offending process via Activity monitor.

Maybe this http://www.oreillynet.com/ruby/blog/2006/04/nubygems_symbolic_starvation.html has something to do with it?
I don’t know ruby, but I did a quick google to see what the problem could be.

I also noticed that if I restart Apache via the Sharing preference pane, the old ruby processes are left hanging in the air and new ruby processes are spawned for the Tracks app. This gives me a double set of ruby processes, albeit the old ones consumes 0% CPU, 80 KB of real memory and 44 MB of virtual. Is there someway to make the ruby processes go down with apache, or do I have to manually delete them every time?

And is there anyone else who has experience of the same thing?

Cheers!

Profile
 
lukemelia
Posted: 17 December 2006 03:08 PM   [ Ignore ]   [ # 1 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18

TiGGr: Are you running in Rails development mode by any chance? There are known memory leaks in this mode.

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
TiGGr
Posted: 17 December 2006 06:54 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  2
Joined  2006-11-12

Aha, yes as a matter of fact I did. I checked, and my production.log was completely empty.
I have now switched to production mode, crossing my fingers that it will help.

Thank you very much!

Profile
 
lukemelia
Posted: 17 December 2006 07:07 PM   [ Ignore ]   [ # 3 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18

No problem. This bit me when I first started running Rails apps, too.

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
bsag
Posted: 18 December 2006 08:55 AM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

Incidentally, if you’re only running Apache on your local machine to run Tracks, I’d highly recommend trying out lighttpd. It’s pretty easy to install, and much lighter weight than Apache. But anyway, running in production mode rather than development should fix your problem as Luke suggested. It will also make it a lot faster!

Profile
 
Craig
Posted: 18 December 2006 01:47 PM   [ Ignore ]   [ # 5 ]  
Newbie
Rank
Total Posts:  28
Joined  2006-06-28

What size file should production.log be, and does it matter (in terms of speed)? Mine is 110.5 MB.

Signature 

Tracks 1.042 on Locomotive / Camino 1.0.1

Profile
 
bsag
Posted: 18 December 2006 08:12 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

Craig: Any of the log files will just grow with use (development.log faster than the others), so it’s a good idea to clear them out once in a while. Either open the file manually, select the contents and delete and save, or run a rake task inside your Tracks directory:

rake log:clear 

That will clear all the logs in one go. If you’re using Tracks on a remote host, it’s a good idea to set up a cron task to run that rake command once a week or so, so that the log files don’t get too huge.

Profile
 
Craig
Posted: 18 December 2006 08:24 PM   [ Ignore ]   [ # 7 ]  
Newbie
Rank
Total Posts:  28
Joined  2006-06-28

that rake command returns

-bash: rake: command not found 


I’ll try opening it in a text editor.

Signature 

Tracks 1.042 on Locomotive / Camino 1.0.1

Profile
 
bsag
Posted: 18 December 2006 10:05 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

Odd. Can you see the command listed if you run:

rake --tasks 

It’s possible it was added as a task in a later version of Rails than the one distributed with Tracks 1.043, but I thought it was in most versions of Rails. Anyhow, just open and clear the contents in a text editor, or even faster, put this into a terminal (with the paths changed appropriately, of course:

> /PATH/TO/TRACKS/log/production.log 

Profile
 
Craig
Posted: 18 December 2006 10:40 PM   [ Ignore ]   [ # 9 ]  
Newbie
Rank
Total Posts:  28
Joined  2006-06-28

I’m running Locomotive. I think that affects my ability to run these rake commands. I found some rake executables in various bin directories within the Locomotive bundle, but I’ve had no success running any of them.

Clearing the contents in a text editor worked, so at least that problem is solved.

EDIT: Figured it out. In the Locomotive window, I ctrl-clicked my tracks entry and selected Open Terminal. From that terminal window, the rake command worked.

Signature 

Tracks 1.042 on Locomotive / Camino 1.0.1

Profile
 
   
 
 
‹‹ Problems with the login page not showing      How to activate the tickler function ››

Powered By ExpressionEngine
Template Design By Sonnenvogel.com
Select a theme:

ExpressionEngine Discussion Forum - Version 2.1.1 (20081028)
Script Executed in 0.1610 seconds

Atom Feed
RSS 2.0