A simple program for LIfe,Universe And Everything in java is showing 4468MB memory use. How come?
Code:
import java.io.IOException;
import java.util.Scanner;
public class Main
{
public static void main(String[] args) throws IOException {
Scanner sc=new Scanner(System.in);
long no;
for(;;)
{
no=sc.nextLong();
if(no==42)
{
sc.close();
break;
}
System.out.println(no);
}
}
}