ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1220. Stacks

Doing nothing exceeds the memory limit in Java
Posted by Peter Lawrey 4 Jan 2013 19:14
If I run

public class Stacks {
    public static void main(String... args) {
        System.gc();
    }
}

It reports I exceed the memory limit with a usage of 4885 KB.

public class Stacks {
    public static void main(String... args) {
        System.gc();
    }
}

Reports 326 KB used.

How is the memory usage determined.  I assume you cannot have your managed memory trigger a GC which is a bit restrictive for Java.