Space Complexity

How does an online judge estimates the space complexity of the program?

You are given some memory (typically 256MB) and your code has to work in it.

Meaning, you can declare variables, arrays etc. till this memory limit. The moment you exhaust/exceed this limit, you are given the required verdict (usually SIGSEV).

Some problems allow higher and even lower memory than standard.