This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
High memory usage resolving scenarios with drophips, warships etc
#21
Another option that might be a little easier is to try launching MHQ from the command line with the following options:

Code:
java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=heapDump.hprof -jar MekHQ.jar

This will launch MHQ as normal, but if you run out of memory while the app runs, it will create a "heapDump.hprof" file.  The file will be fairly large (around a gig since that's the memory limit configured), but you can zip it up and it will compress nicely.

Note, this only works if you're getting an actual OutOfMemory error.  If memory usage is just high, but you never actually run out, you would need to use the method described by Arlith.
Reply
#22
(07-07-2014, 01:16 PM)SirMegaV link Wrote:Thanks ralgith.. but i seriously do not understand...

1. Java bin directory is on your path?
2. <pid> = process name found in task manager?
3. running jps?

I'm lost, I will stick with the testing... Smile

1. There are many tutorials found by google for editing the Windoze path.
2. PID is Process ID, not name.
3. If you run jps.exe it will tell you the PID for all running Java instances. Much easier than wading through the full process list.
Reply
#23
If I remember correctly, jps is the only way to get the process id for a JVM in Windows.  I don't think task manager will tell you the PID.  But, I never do this in windows, so I could be wrong. 
Reply
#24
(07-07-2014, 05:58 PM)Arlith link Wrote:If I remember correctly, jps is the only way to get the process id for a JVM in Windows.  I don't think task manager will tell you the PID.  But, I never do this in windows, so I could be wrong.

I think it may depend on the version of Windows.
Reply
#25
(07-07-2014, 02:49 PM)Netzilla link Wrote:Another option that might be a little easier is to try launching MHQ from the command line with the following options:

Code:
java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=heapDump.hprof -jar MekHQ.jar

This will launch MHQ as normal, but if you run out of memory while the app runs, it will create a "heapDump.hprof" file.  The file will be fairly large (around a gig since that's the memory limit configured), but you can zip it up and it will compress nicely.

Note, this only works if you're getting an actual OutOfMemory error.  If memory usage is just high, but you never actually run out, you would need to use the method described by Arlith.

I just added Java bin to the path and tried running java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=heapDump.hprof -jar MekHQ.jar, but receive the error "Unable to access jarfile MekHQ.jar. What did I do wrong?
Reply
#26
(07-08-2014, 01:29 PM)SirMegaV link Wrote:I just added Java bin to the path and tried running java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=heapDump.hprof -jar MekHQ.jar, but receive the error "Unable to access jarfile MekHQ.jar. What did I do wrong?

Were you in your MHQ folder when you tried to launch it?  If not, you need to be.
Reply
#27
You might want to get familiar with the commands for the windows command prompt. A google search for basic commands will give you some links on tutorials. Or click here for one I found.
It might be weird to get use to but just think of it as a text based adventure with no graphics. At least that is how I imagined it until I got use to it.
Reply
#28
Yes, I was running it from the MekHQ folder. Attaching the screen capture.


Attached Files Thumbnail(s)
   
Reply
#29
Apparently I'm a bit behind the times.  I didn't realize we were wrapping the jar file into an exe these days.  Apparently that happened a year or two ago and as I always compile from source, I never noticed.

Unfortunately that means the method I gave you for getting a heap dump won't work.

Theoretically, though I've never tried this myself, you should be able to edit the mekhq.l4j.ini file to include to two additional arguments and that should work.  Just open the file in notepad and add the two parameters:

Code:
# Launch4j runtime config
#you can add arguments here that will be processed by the JVM at runtime
-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=heapDump.hprof
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Suggestion - confirming kill list when resolving manually MagnusEffect 12 4,267 07-09-2014, 12:09 AM
Last Post: pheonixstorm
  Memory usage pheonixstorm 10 3,819 04-29-2014, 12:04 PM
Last Post: ralgith
  Usage for remote players sshagent 9 4,670 09-21-2012, 05:19 AM
Last Post: sshagent
  When resolving my scenario the salvage file causes an NPE. ralgith 5 2,669 01-14-2012, 11:33 AM
Last Post: ralgith
  Adjusting Memory Usage in Megamek called by MekHQ Alemnyr 5 2,846 12-31-2011, 06:20 AM
Last Post: Alemnyr

Forum Jump:


Users browsing this thread: 1 Guest(s)