Some interesting additional java parameters: B.1 HotSpot VM Command-Line Options – Troubleshooting Guide for Java SE 6 with HotSpot VM

Option to automatically make memory dump when OutOfMemory occurs sounds rather interesting.

These utilities, should exist in all java deployments:

  • jps: List PIDs of java processes
  • jmap: Make heap of java process (jmap -dump:format=b,file=test.hprof PID)
  • jinfo: Modify ”-X” and ”-XX” flags on-the-fly in java process
  • jstack: Get stack trace of java process

PS. According to one source, ”Huge methods (8000 bytes of bytecode) are not JIT compiled with HotSpot.”, this indicates that huge methods really must be avoided. So if you’ve habit of writing very length methods, there is two reasons to get rid off such habit:

  1. Code maintainability and readability. Making smaller methods makes analysis of the code much easier for fellow developers. Also it opens paths for otherwise unseen optimization, code reuse, etc. possibilities.
  2. Allowing Java JIT to perform its’ task
/ java

Vastaa

Sähköpostiosoitettasi ei julkaista. Pakolliset kentät on merkitty *

This site uses Akismet to reduce spam. Learn how your comment data is processed.