My java code uses too much memory, I am not sure why

My Solution

The problem inputs are N,M,K<=2500
The program works correctly, but uses about 4 gb memory. I have used some global variables and no recursive methods.
I don’t understand how the program can use so much memory.

Please help!

don’t worry, due to the compiler flags, any java code submitted here will consume that much amount of memory.

1 Like

Thanks for your reply.
Understood.