public class MemoryLeakExample {
    public static void main(String[] args) {
        while (true) {
            System.gc();
        }
    }
}
How is memory leaking in this program? Memory is gradualy increasing while monitoring through the NETBEANS profiler. Guide me if am wrong, any help is appreciated. Before 5 min USED HEAP SIZE is :2257416 After: 2258360
Thank you.
 
     
    