+ 2

“Memory limit exceeded” and “Compilation error” in Code Playground

What causes a program to return these messages? I’ve never seen these while trying to run programs through Netbeans or via command line, so I’m assuming these are specific to the Code Playground. I suspected that “Memory limit exceeded” might have been caused by a mistake in implementing a recursive method (i.e., maybe the message masked a StackOverflowError), but a test program I made to intentionally trigger that returned a StackOverflowError with stacktrace and “Time limit exceeded” instead. So I still have no idea what the underlying problem is. “Compilation error” is even more confusing, because I came across it when trying to run a program which had previously compiled correctly and had not been modified. It worked when I ran it again, so it seems like whatever problem there is is actually happening at runtime (and is probably somehow tied to output from the RNG). If it’s relevant, I’m using the iOS app and coding in Java.

25th Aug 2018, 4:18 PM
krikkitbot
krikkitbot - avatar
4 Antworten
+ 2
Time limit exceeded because the code takes more than 5 secs so the code playground stop running program and writes "Time limit exceeded" And the code playground works online so it shows ouput in same execution and you must write all inputs separated with("\n") in same case and its limit is 5secs. Example; when use an infinity loop(E,g: while True) it cant wait infinity time so it stops.
25th Aug 2018, 4:50 PM
Sousou
Sousou - avatar
+ 2
Compilation errors happen in and out of the playground, though in your IDE it probably won't display like this, but highlight the error in red (your program won't even be able to run, whereas here it will only notify you once you attempt to run it, but again the program won't actually run) Memory limit can happen if you try to store too much data in a list or something, due to the limits placed by sololearn. This can also happen locally but normally you have a loooot more memory so you'll have to try quite hard to produce it
25th Aug 2018, 6:17 PM
Dan Walker
Dan Walker - avatar
0
What about memory limit or compilation error?
25th Aug 2018, 4:51 PM
krikkitbot
krikkitbot - avatar