Skip to content

Instantly share code, notes, and snippets.

@magicdude4eva
Last active November 27, 2021 11:43
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: If the above helped you in any way, then follow me on Twitter or send me some coins:

(CRO)    cro1w2kvwrzp23aq54n3amwav4yy4a9ahq2kz2wtmj (Memo: 644996249) or 0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C (Cronos)
(USDC)   0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C
(BTC)    3628nqihXvw2RXsKtTR36dN6WvYzaHyr52
(ETH)    0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C
(BAT)    0xb83c3Fe378F5224fAdD7a0f8a7dD33a6C96C422C
(LTC)    MQxRAfhVU84KDVUqnZ5eV9MGyyaBEcQeDf
(Ripple) rKV8HEL3vLc6q9waTiJcewdRdSFyx67QFb (Tag: 1172047832)
(XLM)    GB67TJFJO3GUA432EJ4JTODHFYSBTM44P4XQCDOFTXJNNPV2UKUJYVBF (Memo ID: 1406379394)

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. Sign up with Coinbase and instantly get $10 in BTC. I also accept old-school PayPal.

If you have no crypto, follow me at least on Twitter.

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