I have two simple java codes.The first one defines constant power as power = a.pow(b);
import java.math.BigInteger;
public class FermatOne
{
publ
It's just a guess, but BigInteger.ONE.shiftLeft(332192810);
will internally create an int
array of length x + 10381025
. Since an int is 4 bytes big you'll get about 40 mega bytes of data just for that one call. I assume the other calls copy that data around and thus you get that high a memory consumption.