Skip to content

Instantly share code, notes, and snippets.

@mishak87
Last active May 20, 2016 09:53
Show Gist options
  • Save mishak87/251e50208df8a9b7a0545a20210372b7 to your computer and use it in GitHub Desktop.
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
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