Had a problem after an update that when I force a restart or a shutdown on my server, it hangs on the last part of the process.
To fix my problem, I had to edit the /etc/default/grub config file and added acpi=force apm=power_off to the config line, between the double quotation marks…
do a update-grub after saving then reboot one more time.. ( force sa restart when it hangs )
After the restart, try another reboot, it should work now without hanging.
Source of the fix is from Here
Memory problem.. the thorn of web apps… I have to connect to my remote server to monitor its memory usage and produce a heap dump.
Bellow is the steps I had to configure the server to allow me to connect a remote monitor tool.
Requirement: VisualVM app, download here
- Access your catalina.sh file.
- Look for JAVA_OPTS, if none found, you can add your own.
- Add …
to the line if found, if not, you can do
JAVA_OPTS="JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/heap/dump/folder/"
The above code will force a heamp dump when the server encounter a out-of-mem exception.
- Next, to enable remote memory monitoring, add these commands after the line above, within the quotation mark, add proper spacing after each command…
- Now, run VisualVM and create a new JMX remote connection, under the CONNECTION field, add host_ip_address:port_num
Congrats! You should now be able to connect to your server and monitor your memory usage!