Skip to content

Tag: heap-memory

About VM arguments

Am I right in thinking that when one specifies VM arguments in an IDE (I’m using NetBeans in this instance), that these arguments are only passed when the code is run through the IDE itself? Essentially, I’d like to specify that when my program runs, the VM’s minimum/initial heap size is 2Gb…

System stack allocation in recursion

As we all know that all most all recursive functions can be modified to iterative approach. Suppose we take an example of adding two linklists which represent two huge numbers. This question can be solved either by recursion (which uses system stack) or iterative (explicit stack usage) approach. My doubt here…

EXE4j Jar to exe error

I’m recently Java 7 update 21 JDK and i created java application with netbeans For distributing my jar i use Exe4j 4.5.2 Jar to exe. Now when i used Exe4j it creates exe but when i execute it it shows me error message. “The JVM could not be started. The maximum heap size (-Xmx) might be too large …

Why are reference types stored in heap

I do know that in Java, (perhaps in .net too) , primitives are stored on stacks , where as reference types are stored on heaps. My question was that I do not understand the proc/cons for this behavior. Why can’t we reference a memory location inside our stacks instead? . I couldn’t find a proper e…