Last active
May 20, 2016 09:53
-
-
Save mishak87/251e50208df8a9b7a0545a20210372b7 to your computer and use it in GitHub Desktop.
Atom.io Memleak - reload when free memory is less or equal 5 % ~/.atom/init.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
os = require('os') | |
window.setInterval (-> | |
free = Math.round((os.freemem() / os.totalmem()) * 100) | |
console.log 'Free memory: ' + free + ' %' | |
if free <= 5 | |
atom.reload() | |
return | |
), 60 * 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment