why java code take too much memory?

i just uploaded my first java program in codechef and it took 1399M memory… why does java program takes too much memory??

That’s probably because memory usage is “incorrectly” counted on SPOJ servers. It seems to me, that they count memory usage of JVM instead of your program and while -Xmx is set to 1280M, it is with JVM own memory almost 1400M of memory…

this is because firstly the jitter takes 177 M what ever ur simple solution is…
and yes java is more expensive then c, c++ in terms of memory

1 Like
//