Thanks for your reply Mahadev - I wonder if you can elaborate on how you get to your observation of most applications that use ZooKeeper needing JVM heap size > 64M. Our platform uses ZooKeeper to manager cluster of hundreds of nodes with -Xmx32m. The only time I observed OutOfMemory issue is when my application goes into endless loop injecting messaging into a ZooKeeper queue.
Allowing ZooKeeper server to take up 3G out of 4G physical memory seems excessive, imprudent.