|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Claudio Miranda's Blog
HotSpot InternalsPosted by claudio on August 20, 2008 at 08:39 PM | Permalink | Comments (0)There is a wiki site at Sun, about HotSpot Internals, with valuable information to people who wants to better understand HotSpot but don't have the proper time to dedicate to such good reading of HotSpot source code. As an example, there are tips about how to optimize Java code to the best and how HostSpot sees it Jetty and Solaris 10Posted by claudio on July 16, 2008 at 10:31 AM | Permalink | Comments (0)This is a contribution to Jetty Web Server, to allow SMF on Solaris 10 machines to manage Jetty servers, see the benefits
So what is SMF ? It stands for Service Management Facility. See more information at OpenSolaris website. And a small excerpt from their website "Self-healing services are delivered and managed on Solaris with the Service Management Facility (smf(5)). smf(5) augments the existing init.d(4) and inetd(1M) startup mechanisms, promoting the service to a first-class operating system object." I want to let you know there is other contribution from Trygve Laugstol, where he made available a Jetty package on blastwave repository (it is outdated). If you want to use SMF to manage Jetty, get the software (it points to the Jetty patch 639) Rant There is a bug on Serviceability on JDK, that can lead to problems running jmap on java process started by non-root users that can bind to privileged ports (in fact if the process have called setuid on solaris). This bug happens, if jmap -heap PID is called, like this example # /opt/jdk1.6.0_07/bin/jmap -heap 21862
Attaching to process ID 21862, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 10.0-b23
......
concurrent mark-sweep generation:
capacity = 125829120 (120.0MB)
Free chunk in CMS heap, size=65536
Free chunk in CMS heap, size=1048
Free chunk in CMS heap, size=1048
Free chunk in CMS heap, size=256
Free chunk in CMS heap, size=256
a lot of free chunk messages, until ctrl+c
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.tools.jmap.JMap.runTool(JMap.java:178)
at sun.tools.jmap.JMap.main(JMap.java:110)
Caused by: java.lang.RuntimeException: VM.initialize() was not yet called
at sun.jvm.hotspot.runtime.VM.getVM(VM.java:359)
at sun.jvm.hotspot.oops.ObjectHeap.newOop(ObjectHeap.java:342)
at sun.jvm.hotspot.memory.CompactibleFreeListSpace.getLiveRegions(CompactibleFreeListSpace.java:138)
at sun.jvm.hotspot.memory.CompactibleFreeListSpace.used(CompactibleFreeListSpace.java:68)
at sun.jvm.hotspot.memory.ConcurrentMarkSweepGeneration.used(ConcurrentMarkSweepGeneration.java:61)
at sun.jvm.hotspot.tools.HeapSummary.printGen(HeapSummary.java:182)
at sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:94)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:39)
Please vote for this bug, if you want to use jmap in such conditions. Tools and Tips slides availablePosted by claudio on June 25, 2008 at 06:36 AM | Permalink | Comments (0)You can see my presentation about Tools and Tips to Diagnose Performance Issues on-line or download it. All of them are hard questions. As there is no recipe to answer them. R.1) There is no "best value" it depends of the java runtime system. If possible, do some experiments, to see how it behaves for different sizes. But the lower the size, more memory efficient. I had worked with 256k and 512k, for application servers. Depending of the operating system and JDK, the java stack size, is the same as the operating system, see it: $ ulimit -a|grep stack stack size (kbytes, -s) 8192 R.2) If possible, don't configure it, let JRE set its default value. But, as someone have asked, see it below. If young generation needs to be customized, it means the default don't apply here. Java runtime needs to be monitored to understand the allocation activity going on and out of young generation. Try to adjust it in a way that don't span a full garbage collector (on old generation) very often. If there is memory leak going on, a full gc can be triggered. R.3) That is the hard one, as JDk 1.3 has reached End of Line support at Sun and lack most serviceability found in recent JDK, like jmap and jstat. With JDK 1.3 one can use some unix tools to introspect the process, but the atendee asked about windows, that is even bad, because I do not do much work on windows platform and have no knowledge about windows diagnostic tools. What I really recommend, is to reproduce the java system in a isolated machine, use at least JDK 1.4 latest release and configure -XX:+HeapDumpOnOutOfMemoryError. If the system is flexibe, put the application on more recent releases of JDK and servers. Diagnose performance issues at JazoonPosted by claudio on June 13, 2008 at 10:23 PM | Permalink | Comments (0)Jazoon 2008
Next week I am heading up to the northern hemisphere to join a crowd of Java professionals and enthusiasts to participate to Jazoon conference. Tools and Tips to Diagnose Performance Issues is the session I am going to share tips and tools to help diagnose performance issues on Java applications. Some of them are heap and thread dump analysys, OutOfMemoryError, system performance, monitoring and profiling. If you plan to attend Jazoon, please take a look at the session. It is going to be challenge to fit a lot of information on 50 minutes (including questions). I plan to attend other similar sessions to learn a bit more about this matter. Do you remember the days you asked "How can I detect which class is consuming a lot of memory at the production site ?", "Which monitor is locking all threads ?", "Why are there so many http connections being queued ?", those are some answers I plan to talk about at the session. The first day, is the community day, as there are going to happend GlassFish and NetBeans day at Monday from 9am to 3pm. The good news, it is free, but you need to register in advance. Besides the beautiful city (which I want to spend some time outside the conference), what I find very interesting is the talks with project leaders, community members and developers from different cultures. |
August 2008
Search this blog:CategoriesCommunity: Java ToolsCommunity: NetBeans JavaOne Open Source Performance Programming Archives
August 2008 Recent EntriesTools and Tips slides available | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
|