Announcement

Collapse
No announcement yet.

System.OutofMemoryException 4.2.5.0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by Rutger View Post
    There are many topics about this on different forums. I had these issues for years, with every version of Homeseer (HS2, HS3, HS4 and never wanted to stop the system because there was so much affected by this). Recently I've really started the HS4 system from scratch (I moved and wanted to change the system anyway, and definitely get rid of the memory issues) and I ran every plugin and built the script mostly from scratch. In the end, a new script was first running for days to see the difference in memory usage. When it was stable, II added the next script, etc, etc. In my case, there were a few .vb scripts that were causing the out of memory issues. It took me 3 or 4 weeks to find out the cause, rewrite the scripts, and now it's super stable. It run HS4 (every time the latest version) for weeks in a row and its constantly under 120 MB usage.
    Rutger Could you elaborate on script changes that reduced your memory usage?

    Comment


      #17
      Could you elaborate on script changes that reduced your memory usage?
      In some scripts, I had to declare variables to Nothing or empty device arrays at the bottom of the script, especially when using For-Loops:
      • DevicesArrayE.Clear()
      • DVAddress = Nothing

      And also a proper handling of mysql connections, where in the end the connection is closed and disposed:
      • conn.Close()
      • conn.Dispose()
      At the bottom of every mysql connection script, I've now a check for an open connection as well. When the connection is still open, then it will be closed and disposed.​
      On top of this, every mysql script or services is having a unique user to the mysql database/table, so I can keep track of open processes and see if connections are closed properly.

      ​I actually reviewed ALL my scripts and made in the most of them, really big changes. Also in the way how virtual devices are created, etc, so it's not just the 4 bulletpoints from above.

      Comment

      Working...
      X