Garage Monitor: Garbage Collection, and jQuery Animations

Here is a quick update summarizing the changes I have made over the past few days. I am convinced I have removed 99% of the memory leaks. The memory on my Raspberry Pi stayed pretty stable yesterday.

The summary of what has changed is this:

  1. import gc was added to garagemonitor.py (the Python Garbage Collector).
  2. gc.collect() was added to the end of my main loop (so its runs on each cycle and tries to free any orphaned variables/objects).
  3. keep_garage_monitor_active.sh bash script was created to researt the garagemonitor service when the script is no longer in the process list (for some reason it has terminated a couple of times on me, I am not sure why).
  4. The Status web page no longer reload the entire page every 10 seconds. Instead, it now uses AJAX to query the Web Service every 5 seconds. It now only reloads the page when the status has actually changed. This saves workload and bandwidth for the server, and moves more of the work to the client’s browser.
  5. The Status web page background grows bright then returns to the normal color to indicate when the status has been updated.

I may even rework the status webpage all together again so it never reloads the entire page again. I am looking at the jQuery Mobile framework right now.

As always a stable version of my code is avilable at Github.
github.com/brianhanifin/GarageMonitor

2 thoughts on “Garage Monitor: Garbage Collection, and jQuery Animations”

  1. Is there anyplace where you have posted schematic of circuit you used and also parts list you used for that circuit. If possible i would like to have those!

Leave a Reply