Thursday, December 16, 2010

Findbug - A useful tool for Java developer

Findbug is useful in developing a clean and efficient code if you are a java developer.

Go to the below link to know more about it.

http://findbugs.sourceforge.net/manual/eclipse.html

You can also use Findbug using maven by adding the plugin. But if you have a eclipse, you should prefer it that way.

Thursday, December 2, 2010

Steps to disable OOM Killer on Linux

OOM kills any process which has been waiting for a long time. But some times, we need to avoid this and make sure these long waiting processes are allowed to complete even if it takes much more time.
To disable OOM, follow the below steps.

Check status of oom-killer:

# cat /proc/sys/vm/oom-kill

Turn oom-killer off/on:
# echo "0" > /proc/sys/vm/oom-kill
# echo "1" > /proc/sys/vm/oom-kill

To make this change take effect at boot time, add the following
to /etc/sysctl.conf:
vm.oom-kill = 0

For processes that would have been killed, but weren't because the oom-
killer is disabled, you'll see the following message
in /var/log/messages:
"Would have oom-killed but /proc/sys/vm/oom-kill is disabled"