Coder Social home page Coder Social logo

heater's Introduction

heater

Just a small Java program which loads an image over and over again until an OutOfMemory is reached.

The goal is to test the upper limit of the Java heap, combined with cgroup limits inside an container.

To print the configured values in the JVM add: -XX:+PrintFlagsFinal.

The Docker container can be be pulled from: ninckblokje/heater. For Kubernetes pod.yaml is included.

Notes:

  • The JVM is JDK 17
  • All the output is in KB
  • The JVM will take about 25% of the RAM as heap per default
  • A JVM requires memory for heap, non heap and other thins like sockets
  • Container is build using jib-maven-plugin

Documentation:

No limits

Command:

docker run ninckblokje/heater

Output:

Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
-- 1
free memory: 29812304
total memory: 30408704
max memory: 421527552
-- 2
free memory: 24655952
total memory: 30408704
max memory: 421527552

400 MB limit

Command:

docker run -m 400m ninckblokje/heater

Output:

Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
-- 1
free memory: 7781584
total memory: 8257536
max memory: 127729664
-- 2
free memory: 2793024
total memory: 8257536
max memory: 12772966

50% memory limit

Command:

docker run -m 1g -e 'JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=50.0 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap' ninckblokje/heater

Output:

Picked up JAVA_TOOL_OPTIONS: -XX:MaxRAMPercentage=50.0 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
-- 1
free memory: 15797952
total memory: 16318464
max memory: 518979584
-- 2
free memory: 10809392
total memory: 16318464
max memory: 518979584

Poster time!

heater's People

Contributors

ninckblokje avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.