10

How do you determine how much memory to allocate for your applications?

Sufficient memory * 2?

Comments
  • 4
    Why do you allocate memory in java? If you'd run out of system memory, gc will do its job.
  • 0
    @ganjaman And while it does so, everything just freezes.
  • 3
    @ganjaman to have a controlled environment.
    Also up until some particular version of java8 jvm can kill docker container if run w/o heap limitations
  • 1
    To OP: stress tests, imitation of real use-cases, monitoring memory consumption.
    2x might be an overkill, esp if your app uses 8G under normal circumstances. Picking proper limitations is individual to each app
  • 2
    @leduyquang753 ever considered upgrading from java4?

    @netikras docker is a fair point, but i dont see any reason on actual hardware
  • 0
    @ganjaman virtual machines -- memory baloon [overcommitted vmware's memory]. Rougue jvms could make the whole esx unstable.

    Iron -- shared environments, oomk, memleaks that could be triggered by corner-case scenarios and capable to choke the whole os [assuming oomk is disabled]

    desktop apps - ... It's quite obvious

    overall it's better practice to run your apps in strictly controlled envs.
  • 0
    @ganjaman with oome you could at least get a heap dump triggered for post-mortem analysis. Oomk, dead os -- they leave you no such ability
  • 0
    @ganjaman it’s running in docker.
Add Comment