java always consumes 4284M

I tried everything to reduce memory usage of my java submission. Then, I show others submissions and their submissions also consumes exactly 4284M.

Can anybody explain me why is that?

It will be same for even if you used two integers only.

1 Like

Earlier when people asked that why JAVA used 1286 MB memory, then @admin replied that it was due to the flags set with which your code compiles (eg XEdiags Verbose [hope i spelt it correctly]). If you try to print 10^5 to 10^6 numbers of local machine, it prompts you to use that flag for full output

In short, i think for proper input/output and due to flags set, JAVA solutions always used that much memory, no matter how many variables you declare. (Not sure if declaring array etc. further increases it or not, will appreciate any leads on that!)

//