Skip to content

Instantly share code, notes, and snippets.

@carlpett
Created March 3, 2017 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlpett/7bd0bf087658056a7e863b1d1fdd19a9 to your computer and use it in GitHub Desktop.
Save carlpett/7bd0bf087658056a7e863b1d1fdd19a9 to your computer and use it in GitHub Desktop.
saltstack/salt #39717
from salt import client
from time import sleep
import objgraph
import gc
objgraph.show_growth(limit=3)
def loopetiloop():
i = 0
while True:
caller = client.Caller()
i += 1
print "\n--------{0}--------\n".format(i)
caller.cmd('state.highstate', test=True)
objgraph.show_growth(limit=40)
del caller
loopetiloop()
print "---- done ----"
objgraph.show_growth(limit=40)
gc.collect()
objgraph.show_growth(limit=40)
roots = objgraph.get_leaking_objects()
print objgraph.show_most_common_types(objects=roots)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment