BigCahunaBurger Posted January 6, 2022 Share Posted January 6, 2022 (edited) For farming https://osbot.org/forum/topic/127346-osbot-memory-usage/ Alek talked about max heap size If I want to limit the heap size, are there any recommended levels? Alternatively, it's pretty easy to upgrade my ram to like 250GB but I'm stuck at 24mb of cache regardless of cpu upgrades. Is there a way to increase my heap size and reduce my garbage collection? I'm planning on removing webwalking from my scripts entirely and replacing it with path. Webwalking seems to use too much ram for a serious farm Is there a way to run multiple bots in one cli? That way I don't need multiple separate instances of osbot open (I'm assuming this will use more ram) I realize I tried to do way too much with one script and will now segment it into multiple small scripts that are as tiny as possible, with only one if/then case handling logic in the main loop and only a few if/then conditions per script. The complex script executes fine but at scale seems to be unnecessarily large and likely is hogging more cpu and ram than need be. The logic for handling progressions or changes in the script seems better suited by just exiting the script at the point it should change and starting a new script I am already using the nointerfaces and low cpu cli commands What are some recommended refactoring tips for scripts to minimize ram and cpu usage? Any way I can check to see how big the heap should be with my script? I think I'm thinking of using a memory debugger I read looping more slowly can reduce usage also? How to reduce the loop to once per minute? Edited January 6, 2022 by BigCahunaBurger Quote Link to comment Share on other sites More sharing options...
BigCahunaBurger Posted January 6, 2022 Author Share Posted January 6, 2022 actually to be honest - I think RAM is fine. I probably want to prioritize high ram and low GC. My cpu is probably going to be the bottleneck, I can get up to like 250gb of ram but I'll be bottlenecking with like 24mb of l3 cache Quote Link to comment Share on other sites More sharing options...
BigCahunaBurger Posted January 6, 2022 Author Share Posted January 6, 2022 OK, I think I figured out one of the biggest problems here for overuse of the CPU. I was using recursive logic. I'm honestly more of a LISP than a Java guy. I didn't realize that recursion is totally discouraged in Java. I can use it in Clojure and possibly export the clojure jar to osbot, but that is unnecessary work at this level Quote Link to comment Share on other sites More sharing options...
BigCahunaBurger Posted January 6, 2022 Author Share Posted January 6, 2022 Making stuff static should mean it won't be garbage collected, which should reduce CPU utilization. I'll compare and contrast. I think pathwalking (not webwalking), preventing unnecessary looping (ensuring the main loop does not re-execute prematurely) combined with static variables / objects should reduce the CPU a lot. Quote Link to comment Share on other sites More sharing options...
Chris Posted January 6, 2022 Share Posted January 6, 2022 17 hours ago, BigCahunaBurger said: Is there a way to run multiple bots in one cli? yes make a batch script: https://www.howtogeek.com/263177/how-to-write-a-batch-script-on-windows/ cli will open multiple clients 1 Quote Link to comment Share on other sites More sharing options...
BigCahunaBurger Posted January 6, 2022 Author Share Posted January 6, 2022 24 minutes ago, Chris said: yes make a batch script: https://www.howtogeek.com/263177/how-to-write-a-batch-script-on-windows/ cli will open multiple clients Thanks Chris, I guess what I'm wondering though is whether you can use the -bot parameter for more than one bot? (So one client for many bots) Like java -jar osbot.jar -bot user1:pass1 user2:pass2 user3:pass3 etc RIP to Zyzz king Quote Link to comment Share on other sites More sharing options...
Chris Posted January 6, 2022 Share Posted January 6, 2022 18 minutes ago, BigCahunaBurger said: Thanks Chris, I guess what I'm wondering though is whether you can use the -bot parameter for more than one bot? (So one client for many bots) RIP to Zyzz king I believe currently its 1 bot per client. you could ask @Patrick Quote Like java -jar osbot.jar -bot user1:pass1 user2:pass2 user3:pass3 etc correct. you would add a timeout of 5s or so and make a new line for each java -jar line. 1 Quote Link to comment Share on other sites More sharing options...
BigCahunaBurger Posted January 6, 2022 Author Share Posted January 6, 2022 21 minutes ago, Chris said: I believe currently its 1 bot per client. you could ask @Patrick correct. you would add a timeout of 5s or so and make a new line for each java -jar line. Thanks Chris Quote Link to comment Share on other sites More sharing options...