Coder Social home page Coder Social logo

memhog's Introduction

What even is this?

It's a docker container that will take up more memory as times goes on. By default, it will increase it's memory consumption by 8MB every second, until it hits 128MB and then it will return. If it fails to malloc() at any point in time, it will return with a non-zero return code.

What's this mangle.py?

If one changes the C code, in order to make this Dockerfile distributable easily, mangle.py will generate a new Dockerfile with the C code already embedded. So, to generate the Dockerfile, just run python mangle.py.

How to make it do more or less?

Here's a list of environment variables that will change it's behaviour:

  • MEMORY_LIMIT - setting this to a positive integer will set the limit on how much memory the container eventually will allocate in megabytes.
  • MEMORY_INCREMENT - setting this to a postivie integer will change the amount of megabytes the container will allocate every second.
  • SHOULD_CONTINUE - setting this environment variable will force the process to loop forever when it hits it's memory limit. It won't allocate any more. If an eventual death is required, set the MEMORY_LIMIT variable big enough.

Why?

Because testing.

memhog's People

Contributors

pinkisemils 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.