I found an interesting difference between JVM on Windows vs SunOS.
I start java with a huge amount of memory say 1GB. I wrote a method which exhausts the heap. Interestingly Windows JVM throws OutOfMemoryException as soon as it runs out of heap space. Whereas on SunOS, it takes more than 15 seconds before getting OutOfMemoryException.