@mamatagelanee this is because of how java programs are executed. Codechef uses SPOJ’s platform to run their program, and the memory usage shown by SPOJ is the memory appears to be used by the program to the OS, not real memory. OS allocates memory to JVM and JVM allocates a fixed memory (heap memory) to program when it starts. Since JVM heap size is fixed at SPOJ and is usually more than required by the program, so often code shows same memory consumption.