Monitoring JVM
Hei,
We are a group of students who work on a project for a company. We are trying to monitor JVM using java plungins in a munin server. The problem is tha values that we get are non changable even if we load our JVM, in contrary of the JConsole, all the values of JVM changes constantly. What seems to be the problem? Please help!
Here is an example of the java code we used:
String nyclasser=ManagementFactory.GARBAGE_COLLECTOR_MXBE AN_DOMAIN_TYPE;
RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
List<MemoryManagerMXBean> ny=ManagementFactory.getMemoryManagerMXBeans();
CompilationMXBean CMXbean=ManagementFactory.getCompilationMXBean();
int stor=ny.size();
System.out.println("getboootClassPath------->"+mxbean.getBootClassPath()+"\ngetLibraryPath------>"+mxbean.getLibraryPath()+"\nGARBAGE_COLLECTOR_MX BEAN_DOMAIN_TYPE----->"+nyclasser+"\nsize------>"+stor+"\ngetManagementSpeceVersion----->"+mxbean.getManagementSpecVersion()+"\ngetName---------->"+mxbean.getName()+"\ngetVmVersion---->"+mxbean.getVmVersion()+"\ngetVmVendor----->"+mxbean.getVmVendor());
System.out.println("getStartTime------>"+mxbean.getStartTime()+"\nisBootClassPathSupport ed------>"+mxbean.isBootClassPathSupported());
System.out.println("CompilationMXBean.getName----->"+CMXbean.getName()+"\nCompilationMXBean.getTotal ComilationTime---->"+CMXbean.getTotalCompilationTime());
foreach(MemoryManagerMXBean m in ny)
In JConsole we get a list of applications to choose to monitor , how can we do the equivalent in our little application ?
I think you're talking about JMX and/or VisualVM.
http://visualvm.java.net/
Similar Messages
-
Working wlst script on weblogic 10.3 for monitoring jvm,jdbc,serverstate,et
H team,
please provide me working wlst script on weblogic 10.3 on for monitoring jvm,jdbc,server state, threads, etc.
UNIX OS: solaris X86
email id: [email protected]
thanks
suryaH team,
please provide me working wlst script on weblogic 10.3 on for monitoring jvm,jdbc,server state, threads, etc.
UNIX OS: solaris X86
email id: [email protected]
thanks
surya -
Hi Friends ,
We are on 11.5.10.2 running on RHEL 5, we have recently migrated to linux from windows 2003 server, now we are facing
java.lang.OutOfMemoryError errors in Apache . please help in finding a tool to monitor JVMs on 11i system.
Thanks
RaghuHi Rag;
Please check below thread:
Re: Monitor JVM on Oracle AS Form and Reports
Re: REG: Cloning
also check this search:
http://forums.oracle.com/forums/search.jspa?threadID=&q=tools+to+monitor+JVM+activilty&objID=c84&dateRange=all&userID=&numResults=15
Hope it helps
Regard
Helios -
How to monitor JVM usage on a particulat time.( other than NWA charts ).
at OS level. System is PI 7.0
Thanks
SskI think you can use Jconsole (Never had the need to use it myself)
http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
Regards
Juan -
How to monitor JVM on AIX box?
Hello Nwuser8880
I have moved this thread to the Netweaver Administrator forum (this is not a PI technical issue). I think you have a better chance of getting a quality answer to your query in the Netweaver Administrator forum.
Regards
Mark Smyth
XI/PI Moderator -
Hi All,
Is there a ways to monitor/change JVM parameters at runtime?
Example
If I pass a custom jvm parameter in the following way:
java -Dmy.custom.argument=myvalue -jar Stylepad.jarIs there a way to monitor this argument (-Dmy.custom.argument=myvalue) at runtime with both read and write permissions?
As far as I know the platform management mbeans only allows us to view such jvm parameters in read only mode (via java.lang.Runtime MBean).
Could any one help me to solve this problem?
Thanks in Advance!
JiniHi,
You could write your own MBean to do so.
However you should be careful about security: if your MBean allows to change just
any System property and isn't protected then you would be creating a security hole.
There's also a second consideration, which is that changing the value of a System
property at runtime might have no effect: it would mostly depends on how the code
that depends on that System property uses it.
Most applications will read their property only once, at initialization time. Changing
a property after such an application has performed its initialization phase has usually
no effect on that application.
On a pure conceptual/general level I would be tempted to qualify what you are
asking for as 'fragile' (best case) or 'dangerous' (worst case).
If however you still want to proceed in this direction you may be interested by this
blog entry:
http://weblogs.java.net/blog/emcmanus/archive/2006/11/a_real_example.html
It isn't exactly what you are asking for but it may help you on your way.
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc -
How does jconsole know of all monitored JVMs in system?
When you run jconsole, the tab named "local" lists JVMs running and their PIDs. By what mechanism is it able to 'know' which JVMs are running that have been started with the arguments that enable JMX management?
Does jconsole connect to JVMs or to MBeanServers? (Assume each JVM has multiple MBeanServers, and each MBeanServer has multiple domains.)
Also, what's the difference between using the 'remote' and 'advanced' tabs to connect to a JVM? They both have usernames and passwords, but while the 'remote' tab has a host and port, the 'advanced' tab has a URL that contains a host and port within it. So what's the difference - when would you pick one method of connection over another?
Thanks.If jconsole connects to MBeanServers rather than
JVMs, then how can it tell the difference between
multiple MBeanServers that have been started by a
single JVM?JConsole connects to a given JMX connector server which is associated with a given MBeanServer at creation time.
For example, if I have a simple application (i.e. one
JVM) that starts up two MBeanServers in its main
method, using
MBeanServerFactory.createMBeanServer(name). To start
the application, you run the JVM with the
com.sun.management.jmxremote and
com.sun.management.jmxremote.port variables.
How will jconsole know to differentiate between the
two MBeanServers? After all, there's only one JVM -
and it's been started with only one port number.In your example JConsole will not see any of your MBeanServers. It'll see the platform MBeanServer which is the one used by the out-of-the-box management agent.
The next question I have is regarding the JVM - does
any JVM that's started locally show up in the "local"
tab of JConsole (because the JVM is always
instrumented by default - true?), or does it only
appear if you run it with the
com.sun.management.jmxremote variable?The new Attach API in JDK 6 allows JConsole 6 to show all the JVMs running on the local machine although you will only be able to connect to the ones running on JDK 6 (and JDK 5.0 if started with the com.sun.management.jmxremote or com.sun.management.jmxremote.port system properties).
JConsole 5 only shows the JVMs running on JDK 5.0 and started with the com.sun.management.jmxremote or com.sun.management.jmxremote.port system properties.
Have a look at the link below for more detailed info:
http://java.sun.com/javase/6/docs/technotes/guides/management/index.html
Regards,
Luis-Miguel Alventosa
Java SE JMX/JConsole development team
Sun Microsystems, Inc.
http://blogs.sun.com/lmalventosa/ -
I would like to be able to see what happened to the JVM's heap following a
performance test.
I'm really only interested in amount of heap used (ideally for each area of
the heap - in 1.3 onwards). If I could get this figure regularly (say every
5 seconds) I would be able to plot and see from the graph whether I have too
little or too much heap.
Is verbosegc the best way to do this i.e. just get the figures either side
of a gc? Or is there a better way? I don't want a GUI tool as the runs can
take hours and I want to be able to sleep! Just something that outputs to a
file.
Thanks in advance for all advice
Ed"Ed Barrett" <[email protected]> wrote:
I would like to be able to see what happened to the JVM's heap following
a
performance test.
I'm really only interested in amount of heap used (ideally for each area
of
the heap - in 1.3 onwards). If I could get this figure regularly (say
every
5 seconds) I would be able to plot and see from the graph whether I have
too
little or too much heap.
Is verbosegc the best way to do this i.e. just get the figures either
side
of a gc? Or is there a better way? I don't want a GUI tool as the runs
can
take hours and I want to be able to sleep! Just something that outputs
to a
file.
Thanks in advance for all advice
Ed
Verbosegc is a good option. Here is how you can do it. Set the heap size to one
of your lower settings. Turn on verbosegc. See how frequently you collect GC.
If you never do it then you do not use a high amount of memory. If the GC is too
frequent then your heap size is small. -
How to monitor OACore JVM?
Hi All,
ebs r12.1.3
rdbms 11gR2
aix 6.1 64bits.
I would like to know if there's a way to monitor the OACore JVM usage? For example, what's running inside, how much memory free / used, memory used by each process inside, any leak, etc.
Is there a tool to do that?
Thank you!Is this a duplicate post? -- OACore monitoring question
Nayas wrote:
Hi All,
ebs r12.1.3
rdbms 11gR2
aix 6.1 64bits.
I would like to know if there's a way to monitor the OACore JVM usage? For example, what's running inside, how much memory free / used, memory used by each process inside, any leak, etc.
Is there a tool to do that?
Thank you!11i: How To Use Jconsole to Monitor JVM with Oracle E-Business Suite 11i [ID 415455.1]
JSERV Java Processes Not Starting After Upgrade To JDK 1.6.0 on HP/UX [ID 1291679.1]
How to create a Java heapdump on e-Business Suite ? [ID 835909.1]
https://blogs.oracle.com/stevenChan/entry/using_jconsole_to_monitor_apps
Thanks,
Hussein -
Hi,
Our's is a multithreaded application. Recently in production our application is getting hang and stop running after running for sometime. Later we changed the VM arguments we pass at the time of startup and it is running fine. But the same application is running fine in SIT and UAT with the old VM confiuration. We are using JDK1.4 and running on Sun Solaris5.8. The old and new VM arguments are
OLD MEM_ARGS:
-Xms128m -Xmx256m -XX:PermSize=128m -XX:MaxPermSize=128m -Xss512k
NEW MEM_ARGS:
-XX:+PrintGCDetails -XX:+PrintHeapAtGC -Xms128m -Xmx512m -XX:PermSize=32m -XX:NewSize=32m -XX:MaxNewSize=128m -XX:MaxPermSize=128m -Xss512k
Can anyone suggest any VM monitoring tool to monitor the VM statitics and thread stack of my application/process. Can I use monitoring tools comes with JDK1.5 to monitor JVM of 1.4. If ye, how to use it. Please help me as it is very serious problem in Production.Is it at all possible to use JDK 1.5? The monitoring tools/APIs both inside and outside the VM are far superior to those in 1.4. We upgraded to 1.5 immediately after it came out solely because of this.
You've made several changes all at once between your old and new vm arguments. Maybe you could try small sets of changes at a time to help narrow down which set is helping you (for example, try only adding the memory size change by itself). If an Error is thrown in your threads, what catches or logs it? Maybe it'll show up wherever stderr is logged. -
Easy to produce - Memory Leak in JVM Using thread
I was just debugging the problem with our server and got this error (not from the original code, I reproduced it with small code)
at java.lang.Thread.run(Unknown Source)
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at SomeObject.resursiveThreadGeneratorMethod(ThreadRecursionLeak.java:12
at ClientThread.run(ThreadRecursionLeak.java:27)
it is just a simple program generating thread recursively with a lock on an object
import java.lang.Runnable;
import java.lang.Thread;
// <<Objec/Monitor Class>>
class SomeObject{
public synchronized void resursiveThreadGeneratorMethod(int threadNumber, int k){
if(k<=0)
return;
else{
System.out.println("Thread: "+threadNumber + "call number: "+k);
Thread thread=new Thread(new ClientThread(this));
thread.start();
resursiveThreadGeneratorMethod(threadNumber,k-1);
// <<Thread Class>>
class ClientThread implements Runnable{
SomeObject someObject=null;
public static int threadNumber;
public ClientThread(SomeObject someObject){
this.someObject=someObject;
threadNumber++;
public void run(){
someObject.resursiveThreadGeneratorMethod(this.threadNumber,10);
// <<Driver Class>>
public class ThreadRecursionLeak{
public static void main(String [] args){
SomeObject someObject=new SomeObject();
Thread thread=new Thread(new ClientThread(someObject));
thread.start();
is there any way I can monitor JVM memory status (programatically), kill those threads leading to memory leak and send notification to the system admin.
We run JVM 1.4 on the server and need to address this issue as we do not have control over the code that can be submitted to the server, we just do some checks and then let it run on the servers.
Our main requirement is to keep JVM alive and kill all those code and report them.
Message was edited by:
rajanikant_malviyaYou can monitor the JVM with the
[url=http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/i
ndex.html]JVMPI if you're using the Sun JVM.This is native code that basically gets
notified anytime the JVM does something
interesting.
However, you're going to have a very difficult time
catching code that does what the code you show does.
I'm not sure I understand your environment - you
allow people to submit code and you run it? Are you
running it in the same JVM as your server? That
seems like a huge issue. A simple System.exit()
code will take down your server.
Let us know some more details.
We are actually having a portal through witch users can submit their code, witch are basically utility codes for different operations teams.
we then provide a way to schedule them.
At the background, we are having 6 (Win) servers where at each server we are having 20 to 25 users on different ports (managed by our application) running there own JVMs. When a schedule is met we just invoke a servlet (on any free port) and pass code id (stored in DB). And this servlet is responsible for compilation and exicution of the code (We just use Runtime to fork this new process).
I don't know, but is there any way through witch I can monitor this process and restrict to generate threads recursively??? -
Help in writing scripts for monitoring
Hi All,
I am in the position to write scripts for monitoring JVM and JDBC. I know the concept of confiuration MBean and run Time MBean.I planned to use WLShell scripting.In my organization using WLShell is not preferred by anyone. I
dont have any further idea about it. Any other possibilies are there to list the paramters of JVM and JDBC using any scripting.Please help me regrding this.
JasmineI solved that problem.Now i could enter into intractive mode.but couldnt connect to server using connect('weblogic','weblogic','t3://localhost:7001').The servers are up and running.
I am getting the following error.
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
at weblogic.management.internal.RemoteMBeanServerImpl_812_WLStub.getServerName(Unknown Source)
at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:129)
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:585)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx4.connect$2(<iostream>:68)
at org.python.pycode._pyx4.call_function(<iostream>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.pycode._pyx6.f$0(<input>:1)
at org.python.pycode._pyx6.call_function(<input>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at weblogic.WLST.main(WLST.java:113)
Caused by: java.io.StreamCorruptedException
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1301)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:119)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:112)
at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
--------------- nested within: ------------------
weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
<b>Please help me out.</b>
Jasmine -
Memory Monitor API for web application
Hello All,
Does any one knows any API for monitoring memory of a certain web application ??
Thanks in advanceAre there any other ways to monitor jvm state besides JMX? I wonder if there is a specific API to monitor jvm's memory. JMX is the specific API used to create software that monitors the memory in the JRE.
If you want to monitor memory of an application, and don't feel like writing a program to monitor memory, you can use the JConsole application that comes with the Java JDK. -
Hi All,
ebs r12.0.4
rdbms 10.2.0.2
aix 6.1 64bits
Is there a way to monitor the opmn process but more specificly the oacore process (jvm?) like the memomy usage, sessions running on it (and related users) and so on?
Basically, we have 2 oacore process running in prod. We had an issue yesterday where oacore together had more than 860 process. This never happened in the last 2 months. We bounced oacore last night, and its now back to normal with a total of 120 processes.
I found a metalink (443506.1) note talking about JConsole. Is there a way to find the oc4jadmin password? I found the opmn-host and opmn-port in opmn.xml file but I am not sure about the oc4jadmin password.
Thank you,
FelixFelix,
Please see these docs.
How To Use Jconsole to Monitor JVM with Oracle E-Business Suite 11i10 and R12 [ID 415455.1]
How to create a Java heapdump on e-Business Suite ? [ID 835909.1]
Also, search Steven Chan's blog for "OACore" and "JConsole" and you will find many hits.
The default password is "secret" or "oafm" -- Upgrading to the Latest OracleAS 10g 10.1.3.x Patch Set in Oracle E-Business Suite Release 12 [ID 454811.1].
How to startup the iasconsole with R12.1.1
How to startup the iasconsole with R12.1.1
Thanks,
Hussein -
CF 8 JVM memory is not being garbage collected.
I am baffled by something I am seeing on my QA server. I have
an app that we load tested but when the test completed the JVM
memory used was not released. I used CF Server Monitor to watch the
memory usage and sometimes it spiked to the max and either the app
failed or I got timeout exceptions.
This is the only app running on this server and the testing
completed over an hour ago but the memory has not been released
yet.
CF Admin settings:
Maximum JVM Heap Size (MB) 512
The CF Server JVM Setting arguments include: -server
-Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m
-XX:+UseParallelGC
I found a script that uses java.lang.Runtime and
java.lang.management.managementFactory that dumps a JVM memory
usage profile The latest dump follows:
JVM Monitor - ColdFusion Server - Enterprise v8,0,1,195765
JVM Memory Monitor - struct
Heap Memory Usage - Committed 481 MB
Heap Memory Usage - Initial 0.00 MB
Heap Memory Usage - Max 493 MB
Heap Memory Usage - Used 437 MB
JVM - Free Memory 44.0 MB
JVM - Max Memory 493 MB
JVM - Total Memory 481 MB
JVM - Used Memory 449 MB
Memory Pool - Code Cache - Used 8.80 MB
Memory Pool - PS Eden Space - Used 6.37 MB
Memory Pool - PS Old Gen - Used 428 MB
Memory Pool - PS Perm Gen - Used 52.4 MB
Memory Pool - PS Survivor Space - Used 3.50 MB
Non-Heap Memory Usage - Committed 62.8 MB
Non-Heap Memory Usage - Initial 18.3 MB
Non-Heap Memory Usage - Max 240 MB
Non-Heap Memory Usage - Used 61.2 MB
According to the CF Server Monitor JVM memory usage builds up
to 477 MB then the app fails or timesout.
Session Scope memory usage: 0.27 KB
Application Scope memory usage: 1.370 KB
Server Scope memory usage: 3.12 KB
Since the test ended JVM Memory Usage has dropped back to 438
MB?
Besides CFAdmin nothing else is running on this CF Server.
I've read several other memory related topics but none of them have
helped.
Can someone tell me why the memory isn't being release? How
can I further troubleshoot the problem?
Thx
pwp> Adam Cameron wrote:
>
The maximum stable heap size I've managed to get is around
> 1.0-1.2GB, on a win32 system. On Solaris (running a
32-bit JVM),
> about 1.4GB. It *seems* like GC doesn't actually clear
out RAM
> properly if more than that much RAM is being
addressed.
>
> Yes, there is a well-known
>
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19359&sliceId=1
Not really what I was talking about. One might be able to get
the CF
instance to *start* with 1.8GB allocated to the heap, but it
won't actually
work. I've managed to get a server to idle for a reasonable
length of time
on 1.5GB, but as soon as the thing started to ramp up, it
face-planted,
once it started actually trying to *use* the higher end of
the RAM
allocated to it. At 1.2GB, it'll seem to run OK for a
reasonable length of
time, but eventually it starts leaking memory; at around 1GB,
it was pretty
stable.
Hence my comment about it being *stable* at that allocation.
Not that "it
simply won't start if more than 1.8GB is allocated to it".
My point was that your rule of thumb:
maximum heap size(Xmx) = RAM(in MB) / (2 * number of servers
using the
JVM)
Is not a very good one. Plug 4GB RAM (so a small server) and
one CF
instance into that equation. Your rule suggests I should be
allocating 2GB
to the heap. Which - as you yourself pointed out - won't
work.
Adam
Maybe you are looking for
-
Is there any report which I can see the clearing items seperately
Dear Experts, Is there any standard report which I can see manual clearing postings with chargoff amount. Normally this is posting with document type-AB. There are other documents with AB as reversal documents, settlements and other expenses. So we c
-
Using in-house tools vs hosted service
I was recently on a web event and heard about your hosted test service. My client has a small license of e-Load and I am trying to understand when I should use tools versus when I should use the hosted service...are there specific cases where hosted
-
Compressing to cd for web upload
shot 1st promo for studio, what is best way to compress to CD to give to them to load on their website? should i use flash or mpeg? best settings? thanks!
-
Human task notification - Request Info
When configuring notifications for a human task, what is the proper Recipient to set when the Task Status is "Request Info"? If user A requests information from user B, I want to notify user B. So would that be assignees, reviewer, or none of the abo
-
Importing from camera, auto-stack doesn't work
Hi all, I've been using aperture for a while now. According to the manual Aperture should be able to do an auto-stack to the imported pictures and I can see the interval seconds slider on the import page. My camera is Canon 5d and I'm importing raw p