If my application has too many static variables or methods, then as per definition they will be stored in heap. Please correct me if I am wrong
1) Will these variab
It won't cause a memory leak in the classic C sense... For example
Class A{ static B foo; ... static void makeFoo(){ foo = new B(); foo = new B(); }
In this case, a call to makeFoo() won't result in a memory leak, as the first instance can be garbage collected.