frankthetank 0 Posted May 25, 2014 Report Share Posted May 25, 2014 I am trying to get my bot to run 24/7 but at the moment the memory usage over time gets too high and the bot will eventually crash. I made a bot that will visit my site hundreds of times throughout the day and then will repeat the process day after day. I have read various threads about fixing memory issues. I've added change user agent at the start of every loop and also used the memory clearing plugin at the end of each loop (every visit of site), which works for all processes except one browser.exe. This browser.exe will go down to about 1mb temporarily, but after a short amount of time will be using the same amount of memory it did before and continues to climb. I'm not sure if any of this matters but I have UI elements with about 20 different variables that the bot uses to do different things on site. The main define is setup like this: define runbot loop dayafterday (with the condition being if ui element is set to "on" then it will continue indefinitely) loop dailyroutine (condition being to do specific number of visits user specified in ui element) I'm not sure how to fix this, does anyone have any ideas what I'm doing wrong? Thanks a lot. Quote Link to post Share on other sites
Kev 69 Posted May 25, 2014 Report Share Posted May 25, 2014 I have a couple of ideas you could work around... Add a counter and increment every time. Count it till it gets to 100 then have it shell out to the same software but run it from a .bat file with /auto. 100 might be too much/little only you will know that. You could have it shut down after each time it processes what it's needed to do and then restart again afresh. Do it the same as above but without the counter. You could monitor the task scheduler to see how much memory is currently being used and if it's over a certain amount you could have it kill the software and start again - cd c:\ cd FOLDER TO SAVE TEXT FILE IN tasklist >>processes.txt that would be a batch file - your software could call it, read in the txt file and check the memory usage and make a decision from that... So basically my advice to you is to set up a solution that will allow your bot to shutdown and restart during the down time that it's not actually doing anything. Perhaps AFTER it's viewed your website let it restart and shut down the original bot with a stop script... I do a number of the things I mentioned above. It really comes down to what works best for your particular situation. Quote Link to post Share on other sites
Marton 48 Posted May 25, 2014 Report Share Posted May 25, 2014 If you are struggling with the methods Kev just mentioned (I'm doing the same btw), you could use Pash's plugins to automate most steps (Advanced Ubot and Advanced Systems). They have auto bot restart, memory monitoring and memory clearing (you might not even need to restart the bot if you use those well). But as Kev mentioned every app is different (even in Ubot), so the RAM usage peak points could be different too, you'll have to monitor that carefully. In one of my bots it took me weeks till I could find when the memory needs to be cleaned, so get ready for some serious testing. You'll also find that optimizing your algorithm will help a lot (for instance: using large lists and tables will increase memory usage really quickly). Quote Link to post Share on other sites
frankthetank 0 Posted May 25, 2014 Author Report Share Posted May 25, 2014 (edited) Thank you both for the replies. Looks like I might have no other option but to restart the bot. The perfect time would be after it has finished the number of visits for the day as at that point it just waits until the next day before starting the visits all over again. It does add items to some lists for each loop of visit, they are cleared at start of loop though. If I clear every list and table before clearing the memory at the end of each day, might that fix the memory issues without having to restart the bot? I'm currently using this plugin to clear the memory, http://www.ubotstudio.com/forum/index.php?/topic/13444-sell-plugin-os-operating-system-addins/ , does that do the same job as Pash's plugin? Thanks for all the help, it's greatly appreciated! Edited May 25, 2014 by frankthetank Quote Link to post Share on other sites
Marton 48 Posted May 25, 2014 Report Share Posted May 25, 2014 If I clear every list and table before clearing the memory at the end of each day, might that fix the memory issues without having to restart the bot? It could help, and I would also insert a clear memory command there as well (or before actually starting the next round). I'm currently using this plugin to clear the memory, http://www.ubotstudio.com/forum/index.php?/topic/13444-sell-plugin-os-operating-system-addins/ , does that do the same job as Pash's plugin? I think it actually does. Pash's plugin has an auto clear memory function as well (every x seconds), but that didn't work so well for me (might have actually caused some of the crashes). Let us know about your findings too! Quote Link to post Share on other sites
frankthetank 0 Posted May 27, 2014 Author Report Share Posted May 27, 2014 Unfortunately clearing the tables and lists didn't make any difference...I have bought Pash's plugin to restart the bot at the end of each day. So I will see how that works out! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.