MegaMek Discussion Board
Adjusting Memory Usage in Megamek called by MekHQ - Printable Version

+- MegaMek Discussion Board (https://forum.megamek.org)
+-- Forum: Related Applications (https://forum.megamek.org/forum-5.html)
+--- Forum: MekHQ (https://forum.megamek.org/forum-17.html)
+--- Thread: Adjusting Memory Usage in Megamek called by MekHQ (/thread-408.html)



Adjusting Memory Usage in Megamek called by MekHQ - Alemnyr - 12-30-2011

Hi everyone,

I realize that you can edit a file (MegaMek.l4j.ini) included in the Megamek zip to run Megamek with more RAM.

How do I do that with the files included in MekHQ?

Everything I have tried has resulted in failure... Very embarrassing, but I'm hoping someone can help me out.

Thanks,
-Mike


Re: Adjusting Memory Usage in Megamek called by MekHQ - ralgith - 12-30-2011

I love Linux lol... I just made a hack version of the startup.sh Wink

I assume you can just make a batch file that contains this line (for 512MB):
java -Xmx512m -jar MekHQ.jar

I've attached my startup script for MekHQ in case it'll help anyone else.


Re: Adjusting Memory Usage in Megamek called by MekHQ - Netzilla - 12-30-2011

Pretty much.  This is the contents of my batch file:

@echo off
echo Starting MekHQ...
echo.

java -Xmx1024m -jar MekHQ.jar

:done
@echo on


Re: Adjusting Memory Usage in Megamek called by MekHQ - Alemnyr - 12-31-2011

And that adjusts how much memory Megamek will have available when I start a scenario? weird.


Re: Adjusting Memory Usage in Megamek called by MekHQ - Taharqa - 12-31-2011

If you start MegaMek from within MHQ, then they are sharing the same basic memory.  the -Xmx command sets the maximum memory, which I think defaults to 256m on most machines. Eventually, we will get OS-specific releases and there will be an l4j.ini file for MHQ as well, but for now, you need to create a batch file or run from the dos command line.


Re: Adjusting Memory Usage in Megamek called by MekHQ - Alemnyr - 12-31-2011

Awesome. thanks, everyone!