How are you starting the JVM? By default it uses maximum 64MB; there is the -Xmx option which allows you to assign another value as maximum.
Apart from this, a program's total memory consists of more than the heap alone; there's also stack memory which I believe can also be manipulated with a java command line option.