顯示具有 Java 標籤的文章。 顯示所有文章
顯示具有 Java 標籤的文章。 顯示所有文章

2015年12月1日 星期二

32 Bit JVM Memory

Max memory of 32 bit window is 4 GB. 

Q: How about 32 bit JVM?
A: According to the Oracle JVM FAQ, only 1.4 to 1.6 Gb heap memory can be get on 32 bit JVM.
Then, what is heap memory?

Explanation

"Java objects reside in an area called the heap. The heap is created when the JVM starts up and may increase or decrease in size while the application runs. When the heap becomes full, garbage is collected. During the garbage collection objects that are no longer used are cleared, thus making space for new objects."



Memory Structure of JVM:
 

JVM consists of 
  • Heap Memory (runtime data area for all class instances and arrays are allocated and created at the JVM start-up.)
  • Non-Heap Memory, which is used by Java to store loaded classes and other meta-data
  • JVM code itself, JVM internal structures, loaded profiler agent code and data, etc.
What is HotSpot? 
JVM is Java Virtual Machine, which is s software machine that simulate what a machine does. 
HotSpot is an implementation of the JVM concept. There are other implementation of the JVM Specifaction , like JRockit, IBM J9. 

OpenJDK is a project of an opensource implementation of HotSpot (and many other things such as compiler, JDK APIs) 

Reference List of Java virtual machines
https://en.wikipedia.org/wiki/List_of_Java_virtual_machines



2015年11月30日 星期一

JConsole Connect to JBOSS as Window Service

JConsole is a graphical monitoring tool to monitor Java Virtual Machine (JVM) and Java applications both on a local or remote machine.

Problem:
If the JBoss is started as Window Service, the JConsole cannot connect to the process.

Solution:

The below is required to add in Standalone.bat

set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote
set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=8086
set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false
set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false

Then, Start JBoss by Window Service

JConsole Connect to Remote Process
localhost:8086

Reference: http://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html



2011年10月31日 星期一

Eclipse: Content Assist

在Eclipse 上輸入 sysout
image
再按Alt + /
sysout 會變成 System.out.println();
image

更多的設置在
Window –> Preferences –> Java –> Editor –> Content Assist
Window –> Preferences –> Java –> Templates
Window –> Preferences –> General –> Keys