Memory limit exceeded error on Sololearn.
On Sololearn, I noticed that some of my codes could work on an IDE, but, when I run it on Sololearn, I get a "Memory limit exceeded" error, and my code doesn't compile. Such as this code here: import javax.script.ScriptException; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import java.util.Scanner; /*Only works in an IDE - Memory Limit is exceeded if used in Sololearn.*/ public class Calc { public static void main(String[] args) throws ScriptException { Scanner scan = new Scanner(System.in); while(scan.hasNext()){ ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine engine = mgr.getEngineByName("JavaScript"); try{ String equa = scan.next(); if(equa.equalsIgnoreCase("end")){ System.out.println("End."); break; } System.out.println(engine.eval(equa)); }catch (Exception e){ System.out.println("ERROR! Bad input."); } } } } Why does this happen?