The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. December 05, 2008, 10:34:06 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: question regarding scripting  (Read 522 times)
jubegnx
Rookie
**
Offline Offline

Posts: 17


View Profile
« on: June 20, 2007, 05:41:38 PM »

hello all,

my question is how do i prevent mechanize from eating ram viciously?

i've only been messing around with perl for a month or two and i wrote a few scripts that automate some sites and when i run them i noticed it takes 15min to eat the 512mb of ram

i'm sure that its the way i wrote the scripts its just that i don't know what i did wrong.. i compared them to other ones available out there and mine look retarded lol, a million if else statements etc... but there is no errors.

any advice?
Logged
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 373


View Profile
« Reply #1 on: June 20, 2007, 05:54:41 PM »

Hi jubegnx,

that's not easy to answer without knowing the code.

Maybe your arrays are not emptied. If you could give some more code details
or send me the code I would check it.

Dirk
Logged
jubegnx
Rookie
**
Offline Offline

Posts: 17


View Profile
« Reply #2 on: June 20, 2007, 06:13:22 PM »

ok i'm in the middle of trying to fix some things, when i'm done i'm going to run it one last time and then il send it over... thanks
Logged
JasonD
Expert
****
Offline Offline

Posts: 100


View Profile
« Reply #3 on: June 21, 2007, 02:37:57 AM »

Make sure you clean the history.

Most people forget that Mech has a real history function (backwards, forwards, reload etc.) so that is what consumes the memory
Logged
jubegnx
Rookie
**
Offline Offline

Posts: 17


View Profile
« Reply #4 on: June 21, 2007, 07:23:08 PM »

hey dirk, i tried the stack_depth option but now i cant run more than one instance of the script and also it doesn't fully finish the cycles?

** actually it stops within minutes of starting
« Last Edit: June 21, 2007, 07:25:10 PM by jubegnx » Logged
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 373


View Profile
« Reply #5 on: June 21, 2007, 08:07:51 PM »

Have you tried to use different values for stack_depth?
Logged
jubegnx
Rookie
**
Offline Offline

Posts: 17


View Profile
« Reply #6 on: June 22, 2007, 11:08:32 AM »

my mistake, yep the value 1 works i ran 10 instances of the script and it was fine finished the whole thing without running out of memory...

thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!