title: Java : How is memory usage of a program calculated by a java compiler?
body: <p>I am solving <a href="http://www.codechef.com/problems/E1" rel="nofollow">this</a> problem. It desires a memory limit of 50000bytes . So if I allocate a 2D array of int of size 1000 X 1000 , shouldn't it exceed the memory bounds ? </p>
  
  <p>PS : I saw <a href="http://www.codechef.com/viewsolution/243250" rel="nofollow">this</a> solution to the problem and the programmer has allocated a 2D array of size m X m . And if m is equal to 1000, then I think the memory bound will be exceeded. But codechef has accepted his solution.</p>
  
  <p>Is there a faulty mechanism of codechef compiler or am I missing something? </p>