Skip to content

Instantly share code, notes, and snippets.

@magicdude4eva
Last active March 20, 2025 19:02
Show Gist options
  • Save magicdude4eva/93042c0918d92259ec1b64ece661af52 to your computer and use it in GitHub Desktop.
Save magicdude4eva/93042c0918d92259ec1b64ece661af52 to your computer and use it in GitHub Desktop.
import java.util.*;
public class MemEat {
public static void main(String[] args) {
List l = new ArrayList<>();
System.out.println("Max Java Memory (MB): " + Runtime.getRuntime().maxMemory() / (1_024 * 1_024));
System.out.println("Total Memory (MB): " + Runtime.getRuntime().totalMemory() / (1_024 * 1_024));
System.out.println("Max Java CPU Cores: " + Runtime.getRuntime().availableProcessors());
while (true) {
byte b[] = new byte[1048576];
l.add(b);
Runtime rt = Runtime.getRuntime();
System.out.println("*** Free memory: " + rt.freeMemory() );
}
}
}
@magicdude4eva
Copy link
Author

magicdude4eva commented Dec 29, 2019

Donations are always welcome

🍺 Please support me: Although all my software is free, it is always appreciated if you can support my efforts on Github with a contribution via Paypal - this allows me to write cool projects like this in my personal time and hopefully help you or your business.

(CRO)    0xBAdB43af444055c4031B79a76F74895469BA0CD7 (Cronos)
(USDC)   0xBAdB43af444055c4031B79a76F74895469BA0CD7
(ETH)    0xfc316ba7d8dc325250f1adfafafc320ad75d87c0
(BTC)    1Mhq9SY6DzPhs7PNDx7idXFDWsGtyn7GWM
(BNB)    0xfc316ba7d8dc325250f1adfafafc320ad75d87c0
Crypto.com PayString: magicdude$paystring.crypto.com    

Go to Curve.com to add your Crypto.com card to ApplePay and signup to Crypto.com for a staking and free Crypto debit card.

Use Binance Exchange to trade #altcoins. I also accept old-school PayPal.

visitors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment