I have a jar file running on an amazon-ec2-m1.large instance with linux 64bit operating system.
I run out of memory after different hours, usually between 2-4, although in m
Heap is only part of the equation. Have a look at total resident memory - it includes heap and off heap contributions. Off heap includes mapped JARs, thread stacks (~1MB per thread), perm gen, etc. SO has a number of questions on how to do it on Linux.