Posts

Showing posts with the label MLE

How do online judges identify Memory Limit Exceeded?

Image
Question: What is the simplest and most accurate way to measure the memory used by a program in a programming contest environment? Answer I assume you want to know how online judges determine ' Memory Limit Exceeded ' for a user-supplied program. First you may want to read the general architecture of online judges at  TopCoder: How do online judges identify Time Limit Exceeded? where the functioning of online judges has been explained in a very basic way and how they determine  TLE - Time Limit Exceeded  for a program. Here again the the resource limits come to rescue. But the more useful thing that stand by our side is  proc - a file system that contains process information. proc is the key to determining memory usage by a program. It is an interface to kernel data structures and is usually mounted at /proc in a UNIX-based machine. See `man proc` for more detail. For almost every process running in the system, there is a directory created in /p...