Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java : How is memory usage of a program calculated by a java compiler?

I am solving this 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 ?

PS : I saw this 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.

Is there a faulty mechanism of codechef compiler or am I missing something?

like image 718
Nikunj Banka Avatar asked Aug 13 '26 05:08

Nikunj Banka


1 Answers

From the site:

Source Limit: 50000 Bytes

This limit applies to the size of your source code, not to the amount of memory the program allocates. The two are completely unrelated.

like image 121
NPE Avatar answered Aug 14 '26 17:08

NPE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!