Monitoring JVM Parameters

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!
Jini

Hi,
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

Similar Messages

  • New FAQ Entry on JVM Parameters for Large Cache Sizes

    I've posted a new [FAQ entry|http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#60] on JVM parameters for large cache sizes. The text of it is as follows:
    What JVM parameters should I consider when tuning an application with a large cache size?
    If your application has a large cache size, tuning the Java GC may be necessary. You will almost certainly be using a 64b JVM (i.e. -d64), the -server option, and setting your heap and stack sizes with -Xmx and -Xms. Be sure that you don't set the cache size too close to the heap size so that your application has plenty of room for its data and to avoided excessive full GC's. We have found that the Concurrent Mark Sweep GC is generally the best in this environment since it yields more predictable GC results. This can be enabled with -XX:+UseConcMarkSweepGC.
    Best practices dictates that you disable System.gc() calls with -XX:-DisableExplicitGC.
    Other JVM options which may prove useful are -XX:NewSize (start with 512m or 1024m as a value), -XX:MaxNewSize (try 1024m as a value), and -XX:CMSInitiatingOccupancyFraction=55. NewSize is typically tuned in relationship to the overall heap size so if you specify this parameter you will also need to provide a -Xmx value. A convenient way of specifying this in relative terms is to use -XX:NewRatio. The values we've suggested are only starting points. The actual values will vary depending on the runtime characteristics of the application.
    You may also want to refer to the following articles:
    * Java SE 6 HotSpot Virtual Machine Garbage Collection Tuning
    * The most complete list of -XX options for Java 6 JVM
    * My Favorite Hotspot JVM Flags
    Edited by: Charles Lamb on Oct 22, 2009 9:13 AM

    First of all please be aware HSODBC V10 has been desupported and DG4ODBC should be used instead.
    The root cause the problem you describe could be related to a timeout of the ODBC driver (especially while taking care of the comment: it happens only for larger tables):
    (0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
    (0) Code: 2006)
    indicates the Driver or the DB abends the connection due to a timeout.
    Check out the wait_timeout mysql variable on the server and increase it.

  • JVM parameters in MANIFEST file

    I deployed my Swing app in a JAR file wih the following manifest file:
    Manifest-Version: 1.0
    Created-By: 1.4.0 (Sun Microsystems Inc.)
    Main-Class: MainApplication
    Class-Path: . jarfile1.jar ................ jarfilen.jar
    Everything is ok except I don't know how to specify the following JVM parameters: -Xmx256M -Xms128M -Xss1M. Can someone help me, please ?
    Thanks in advance

    Probably these parameters ( -Xmx256M -Xms128M -Xss1M ) must be specified in the properties of the link that launch java -jar yourJar...
    Fabio

  • 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
    surya

    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
    surya

  • Recommended JVM Parameters for Master and ClientManager (v 6.1.0)

    What are the recommened JVM parameters for a master and client manager running on the same Linux machine?
    Current VM Specs:
    OS: Suse Linux
    Processor Count: 4
    Physical Memory: 8GB
    Using Java: jdk1.6.0_13
    Current Master Params: JVMARGS=-Xms2048m -Xmx2048m
    Current Client Manager Params: JVMARGS=-Xms2048m -Xmx2048m -XX:PermSize=128m -XX:MaxPermSize=128m
    Recommendations would be appreciated.
    Thanks!
    Grant Alexander

    What are the recommened JVM parameters for a master and client manager running on the same Linux machine?
    Current VM Specs:
    OS: Suse Linux
    Processor Count: 4
    Physical Memory: 8GB
    Using Java: jdk1.6.0_13
    Current Master Params: JVMARGS=-Xms2048m -Xmx2048m
    Current Client Manager Params: JVMARGS=-Xms2048m -Xmx2048m -XX:PermSize=128m -XX:MaxPermSize=128m
    Recommendations would be appreciated.
    Thanks!
    Grant Alexander

  • Where to find docs for JVM parameters for JDK 1.4?

    Can somebody tell me where to find a complete documentation for JVM parameters for jdk 1.4?
    Thanks in advance

    Start here:
    Performance Documentation for the Java HotSpot VM
    http://java.sun.com/docs/hotspot/
    One of this documents you will find there is:
    JavaTM HotSpot VM Options
    http://java.sun.com/docs/hotspot/VMOptions.html
    Hope this helps.

  • Monitoring JVM in 11i

    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
    Raghu

    Hi 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

  • JVM parameters from Executable JAR

    Is it possible to utilize JVM parameters when running an executable JAR?
    I have an application that process a large amount of data. If I run the application from the command prompt I can use the JVM directive -mx512M to allocate 512MB of memory to the JVM.
    Is there a way of doing the same thing when using an executable JAR?

    In which way are you running a jar without a batch file?
    If you want to make a Java App run with launching according to the operating system's style, unzip JAVA_HOME/src.zip and study the java.exe c source code. Start your own custom java.exe changing its name to yourapp.exe. You can then adorn it with all the things expected on a given operating system.

  • 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/

  • Setting JVM parameters....

    Hi SDN,
    <b>
    I want to check the JVM parameters set for the portal.
    The version of the portal is EP 6.0 SP19.
    Where can I get the information?????
    </b>
    regards
    Brahmachaitanya

    Hi
               You can change the JVM Settings in the ConfigTool.
    Enter the "Java parameters" field for your desired input.
    Save and restart the cluster and you are done!
    You can also check by looking at the instance.properties file.
    Cheers.
    Please award points for helpful answers.

  • Monitor JVM on AIX box

    How to monitor JVM usage on a particulat time.( other than NWA charts ).
    at OS level. System is PI 7.0
    Thanks
    Ssk

    I think you can use Jconsole (Never had the need to use it myself)
    http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
    Regards
    Juan

  • Monitor JVM on AIX

    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

  • JVM Parameters in Applets

    Hi,
    I need to set the jvm parameter in an applet for instance "file.encoding" and
    System.setProperty("file.encoding","UTF8") doesnt work, is there any other way to set the parameters?
    Thanks in advance...

    System.setProperty("file.encoding","UTF8")
    Will throw an exception because the applet is not allowed to do that
    java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding write)
    You need to sign the applet and the consumer of your applet needs to trust the signature
    or the consumer of your applet needs to set up a policy for your applet.
    Or
    The consumer of your applet sets up runtime parameters.
    Here is something I copied and pasted to pass parameters that will force the jre to
    generate a full trace everytime.
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    I think the main question is why do you need to set this property? If you want to write
    something to the local filesystem you should sign or set up policy for the applet
    anyway so I would go with that sollution. Or better yet use an URL object and send the
    data that needs to be saved to a server that does something with it (store it in
    a database).

  • JVM Parameters in Configtool

    Everyone,
    Can somebody explain me how to change JVM paramters in Configtool step by step.
    I opened configtool and Instance_IDXXXXX,Right side i see Servers General and Java Parameters.
    I changed the parameters,saved and restarted the cluster. But,the settings are not getting applied.
    Have I missed any steps? i didn't switch it to edit mode since i was lready able to change it here.
    And i am using <SID>adm. In edit mode,configtool changed to tree structure.
    Can somebody explain me what exactly missing and how to change JVM step by step ? Kindly help..

    Hi. Instead of the path Cluster_data - Instance_ID### - Servers General, follow the path cluster_data - instance_ID### - server_ID#### - 'General' tab - java parameters. Enter the VM settings there.
    Repeat for each server in under the instance_ID### node.
    Save your changes and restart the instance

  • X2100 monitoring hardware parameters CPU temperature

    Hello all!
    I have an X2100 under Linux SLES 10.0
    I'm searching Internet for a long time, but cant get an answer.
    Is there a way to get hardware parameters (CPU temperature/fan speed etc) via SNMP ?
    What software should be installed (of course snmpd is running yet) to do it?
    What MIBs is needed?
    best regards,
    Alex

    Hi,
    this hardware monitoring tools are not giving the real temp out. I tried Hardware doctor and it says that my Qosmio is running about 120 (!!) so I dont think its supposed to be the
    real temperature of my CPU!
    If your FAN is running constantly, maybe your fan and cooling system is clobbed with dust. Maybe cleaning the whole thing would be useful. On the other side, try to adjust the setting in the "toshiba power saver" and try to find settings which fit for you (performance/silence) because you have a powerful system and then its normal that your fan is running high.
    He had to cool a CPU, a VGA and a little bit of heat out of the case.
    Greets

Maybe you are looking for

  • Report parameter does not show up in rtf template

    Hi all I was able to produce an rtf file based on the XML bellow. I could create the header with the customer name and the invoice list with the totals. However, I already tried by any means to insert the AS_OF_DATE parameter in the rtf template but

  • Extracting Data From a Table in Oracle

    How would one extract the data from a table in oracle and put in ascii format file? Do you use sql loader?

  • Check Printing Urgent

    When the invoice numbers flows to another page amount should display in last page.it should print void in first page how to control this,

  • Help with non-Creative Travel Adap

    I have a Zen Plus V 8gb player. I bought a Hammacher Schlemmer travel adapter/converter (00v-240v) with USB port for an upcoming trip around the world. I plugged the USB cable into the mp3 player, however the little battery wasn't indicating that cha

  • QI status in PO

    Dear sapients we have source inspection active in our system is it possible to bring the status of the inspection in purchase order. kantha