Java Mission Control with windows services: disabled functionality - windows-services

I am trying to use the "Log historical data" functionality provided by Java Mission Control to record information about:
- Used Java Heap Memory
- Commited Java Heap
- Maximum Java Heap
of a local tomcat instance running as a Windows service.However I can't add any new graph using the "Add..." button.
It is fine if I try the same with a local application, but some parts of JMC seem to be disabled when connecting to windows services. The Java options that I am using for Tomcat are:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6666
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.local.only=false
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
Any help/suggestion would be appreciated.

Hopefully you've already got an answer for your question, but if not, I have some questions for you:
Which version of JMC are you using?
Can you run JMC with -consoleLog (JDK\bin\jmc -consoleLog | more), so see if you get any - output?
Can't you find the MBeans, or what happens when you want to add them to a graph?
Can you see the MBeans if you connect with jconsole?
//Klara, JMC dev

Related

How to let zabbix know when Java Heap is out of memory on CentOS

My server is running some java processes (Wowza media Server).
And 1 day, it had been error "out of memory java heap".
I want zabbix to detect this issue to send notify email.
Anyone know about this please help, or just give me an idea.
Thank a lot.
I tried to find some commandline to get java heap size,
java -XX:+PrintFlagsFinal -version | grep HeapSize
but this is not what i want.
I want to get the value of heap memory at the time i run the command
You can use JMX to monitor JVM metrics (cpu, threads, memory).
JMX monitoring has native support in Zabbix in the form of a Zabbix daemon called “Zabbix Java gateway”, introduced since Zabbix 2.0.
You can see the documentation here.
As mentioned you can use JVM . For
The interface for the item key "jmx [java.lang: type = Memory,
HeapMemoryUsage.committed]
Does your Host in Zabbix have JMX interface configured? You can see how it should look like in the documentation link, mentioned above. in section: Configuring JMX interface
p.s mostly it is server_ip and port 6969.

JMX Monitoring using jboss-cli

We have an application which used JBoss 4.2.3.GA and we are migrating it to WildFly 8.2. In the old implementation, the JMX monitoring was done using twiddle. Since twiddle doesn't exist in WildFly, we are using the JBoss CLI for JMX monitoring.
Is it the right approach to use the JBoss CLI for JMX monitoring? Are there any command line tools similar to twiddle which can be used for JMX monitoring in WildFly?
One option to get something similar would be to simply query the JMX MBeans programmatically yourself. The advantage here is that your solution can be reused without depending on things like Twiddle which may be discontinued and also are compatible with other app servers.
Here is an example using Groovy to query an MBean in Tomcat and here is an example using Java to query an MBean in ActiveMQ.
If you choose to go with Groovy, you should be aware that there is a way to use Groovy (or Javascript or Python) to wrap the CLI and have more of a control flow. The CLI is great for simple declarative things, but lacks the versatility of a proper scripting language.
If you want to use pure CLI, then that's fine too, but I would suggest you create files which you can then call through bash e.g.:
$JBOSS_HOME/bin/jboss-cli.sh -c --file="my-jvm-monitoring.cli"
You might find this CLI model reference useful and also this blog about monitoring WildFly with the CLI

Neo4j 2.1.1 concern - consistency check of community edition db

Following on from the information found in the blog post titled 'Neo4j 2.1.2 – Maintenance Release', I thought I should check the consistency of a database that has been upgraded to Neo4j 2.1.1.
My set up: Neo4j community edition running on Windows Server 2012 R2 - the binary distribution running as a Windows service (NOT the windows desktop launcher executable).
In the blog post it talks about using the backup tool included with the enterprise version of Neo4j so I have downloaded an evaluation copy (2.1.4) so have access to Neo4jBackup.bat. I cannot however, get a backup to run. No matter what I try I get
Couldn't connect to '127.0.0.1:6362'
or a variation thereof.
I am running
.\bin\Neo4jBackup.bat -from localhost -to D:\DataBackups\Neo4j\check
I have tried specifying a port, specifying IP address, using single://localhost. After consulting the manual more closely I have also amended my config to add
# Enable online backups to be taken from this database.
online_backup_enabled=true
# Port to listen to for incoming backup requests.
online_backup_server=127.0.0.1:6362
Still I receive the same error. I am clearly being a moron. What am I doing wrong? Help!
The question boils down to 'how do I back up a community edition database as alluded to in this Neo4j blog post?
OK so yes. I am a moron. It just came to me. You need to open the database with the enterprise edition!
For anyone who is overcome with a moment of stupidity, like me
Copy the database you wish to check (graph.db by default) to the data directory of your evaluation copy of Neo4j
Start up Neo4j (you may or may not need a store upgrade)
Run .\bin\Neo4jBackup.bat -from localhost -to [your desired backup location]
Sit back and await the results
Feel free to mock/throw rotten vegetables etc at me....! :)
Starting with the 2.1 line (somewhere around 2.1.5 I think) the consistency checker was moved from the enterprise edition to the community edition. It is therefore now possible to check a DB with the community edition too. In the root of the neo4j server directory run:
java -cp 'lib/*' org.neo4j.consistency.ConsistencyCheckTool data/graph.db
Note that this is not an offical API (it's undocumented).

Does Cloudfoundry support apps that require larger memory?

I have been developing a website using grails and demo'ing it using Cloudfoundry. Grails and Cloudfoundry are awesome! The are easy to use with support from grails plugins and tools in STS. My app uses MySQL, MongoDB, SpringSecurity, and more. I have only used it with one user logged in and I periodically get java.lang.OutOfMemoryError: PermGen space I have increased the memory to 1G using the grails plugin. I tried to set JAVA_OPTS to increase the memory and this did not work. I am going to examine where the memory is being used, but it seems that one user and a tiny set of demo data should not be pushing the memory limits.Does Cloudfoundry support apps that require larger memory? After reading this post I set the MaxPermSize to 512M and I no longer have out of memory errors. I'm using grails cmdline on windows and I cannot get more than one JAVA_OPTS set, only the first in a list is used. grails cf-env-add JAVA_OPTS "-XX:MaxPermSize=512m -Xms512M -Xmx512M" This one setting has added stability to my demo site.
The original poster has an answer in the original question:
After reading this post I set the MaxPermSize to 512M and I no longer have out of memory errors. I'm using grails cmdline on windows and I cannot get more than one JAVA_OPTS set, only the first in a list is used. grails cf-env-add JAVA_OPTS "-XX:MaxPermSize=512m -Xms512M -Xmx512M" This one setting has added stability to my demo site
It's a PermGen space, and at this case it's in development mode only (or when you're using Tomcat and redeploy your app few times, its not a CloudFoundry case).
See official FAQ: OMG I get OutOfMemoryErrors or PermGen Space errors when running Grails in development mode. What do I do?

Access JVM properties from command line

I have some JBoss 5.1.0 instances running on JDK1.6 on RHEL5. I would like to access heap/permgen/etc information from their VMs.
The JBoss configuration has not explicitly enabled JMX on the JVM for remote access with JConsole/JVisualVM.
I can access JBoss-related information through Twiddle, and, if I had a GUI on this machine, I would be able to access this information by running JConsole/JVisualVM (JDK 1.6 allows the connection of these clients after the app has been started, even without the com.sun.management options).
Is there a way to access this information without restarting these VMs?
The ways I can envisage doing it are:
Using Twiddle to access this information through JBoss' JMX console - if this is possible, what should I be passing in to find the information?
Using a command line client to connect to the running JDK in the same way that JConsole can. I am aware of cmdline-jmxclient but I don't know if it is capable of this.
The solution is to use jstat:
jstat -gccapacity -t 4994 5s
This line prints out the Garbage Collector capacity information, plus a timestamp for process 4994 every 5 seconds.
You need to be the correct user to gain access to the VM, so for me the above command had to be run sudo -u jboss jstat ....
There's lots more information on the documentation page.

Resources