Announcement

Collapse
No announcement yet.

Increasing Handles and HS Server crashes

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

  • #61
    Originally posted by bsobel View Post

    A thread is unit of execution, often the lowest one in an OS (albeit some support fibers, which are a way of sharing a single thread). Typically one thread can operate at a time per CPU core you have, so if you have 4 cores 4 threads will be running (internally the OS will context swap so you may have 400 threads on those 4 cores with each getting 1/100th of the CPU time per second). A thread handle is just an opaque piece of data that you can use to tell the OS which thread you want to perform an action on. One can, for example, suspend or terminate a thread. Typically the API calls to do this take a thread handle, so they know which of the N threads in the system you are referring to. When a thread exits the handle can stay valid (when queried it would show the thread was done), so while the threads may have run to completion, the question is why aren't the handles being closed (free'd) so they are not building up.
    Great, thanks Bill. So for every thread that HS3 starts, a handle would also be created and since the actual threads are not increasing, it's strictly the handle to the thread that is not properly disposed of. Since I have a lot of scripts, are there things I should be doing in each script to manage that, or should that all be taken care of in the background by .NET or HS (for hs specific calls). Also, what do the handles to the events represent as those are also increasing?
    HS 3.0.0.548: 1965 Devices 1146 Events
    Z-Wave 3.0.1.262: 122 Nodes on one Z-Net

    Comment


    • #62
      Originally posted by sparkman View Post

      Great, thanks Bill. So for every thread that HS3 starts, a handle would also be created and since the actual threads are not increasing, it's strictly the handle to the thread that is not properly disposed of. Since I have a lot of scripts, are there things I should be doing in each script to manage that, or should that all be taken care of in the background by .NET or HS (for hs specific calls). Also, what do the handles to the events represent as those are also increasing?
      If your thread count isn't increasing then yes it sounds like just the handles are remaining. They are typically small so shouldn't have a huge impact (if the threads were staying that would have a much larger impact). (quoted from MS) "Applications can use event objects in a number of situations to notify a waiting thread of the occurrence of an event. For example, overlapped I/O operations on files, named pipes, and communications devices use an event object to signal their completion." Again these are typically small, but generally applications are expected to close the handles they open. This count is mostly likely what Rich was referring to when he mentioned IO causing the issues.

      Comment


      • #63
        Did we ever come up with an answer to this question? I too have a slowly growing handle problem.

        HS.GetURL was questioned. I have several scripts using this to control Hunter Douglas Drapes. I fired off the scripts about 30 times in a few minutes and didn't see any change in handles.

        Comment


        • #64
          Originally posted by prsmith777 View Post
          Did we ever come up with an answer to this question? I too have a slowly growing handle problem.

          HS.GetURL was questioned. I have several scripts using this to control Hunter Douglas Drapes. I fired off the scripts about 30 times in a few minutes and didn't see any change in handles.
          I have not been able to narrow it down. It seemed like I could get my handles stable for a while with certain plugins disabled, but then a few hours later, they would start increasing again. I gave up on troubleshooting it as there was too much impact on my automation routines by disabling the plugins and then waiting hours to see what the impact would be.
          HS 3.0.0.548: 1965 Devices 1146 Events
          Z-Wave 3.0.1.262: 122 Nodes on one Z-Net

          Comment


          • #65
            I'm not sure if this is helpful, sparkman

            The start around 2/12 was HS release version .500
            The start at 3/12 is with Beta .521
            The incline isn't so steep with this version - all else remains the same.
            Click image for larger version

Name:	20180319-handles.PNG
Views:	21
Size:	18.4 KB
ID:	1293627

            Current Date/Time: 3/19/2019 5:31:08 PM
            HomeSeer Version: HS3 Pro Edition 3.0.0.521
            Operating System: Microsoft Windows 7 Professional - Work Station
            System Uptime: 7 Days 2 Hours 16 Minutes 28 Seconds
            Number of Devices: 671
            Number of Events: 149
            Available Threads: 400
            HSTouch Enabled: True
            Event Threads: 3
            Event Trigger Eval Queue: 0
            Event Trigger Priority Eval Queue: 0
            Device Exec Queue: 0
            HSTouch Event Queue: 0
            Email Send Queue: 0
            Anti Virus Installed: Microsoft Security Essentials
            In Virtual Machine: No MFG: asustek computer inc.
            Enabled Plug-Ins
            2.1.0.34: AmbientWeather
            2.0.59.0: BLBackup
            1.0.66.0: BLLED
            2.0.76.0: BLSpeech
            1.3.7.0: Device History
            3.0.0.33: iTunesDAAP
            3.0.0.14: NetCAM
            0.0.0.45: Pushover 3P
            3.0.6681.34300: UltraCID3
            3.0.6644.26753: UltraLog3
            3.0.6922.16073: UltraM1G3
            3.0.6554.33094: UltraMon3
            3.0.6413.20219: UltraNetCam3
            3.0.6358.20184: UltraRussoundAudio3
            3.0.1.259: Z-Wave

            Comment


            • #66
              Originally posted by Monk View Post
              I'm not sure if this is helpful, sparkman

              The start around 2/12 was HS release version .500
              The start at 3/12 is with Beta .521
              The incline isn't so steep with this version - all else remains the same.
              Thanks Monk, I'll give the new version a try this weekend. Below is the overlap between your plugins and mine. Have you done any experimenting with those to see which, if any of those, make a difference on the handle leak?

              1.0.66.0: BLLED
              0.0.0.45: Pushover 3P
              3.0.6644.26753: UltraLog3
              3.0.6413.20219: UltraNetCam3
              3.0.1.259: Z-Wave
              HS 3.0.0.548: 1965 Devices 1146 Events
              Z-Wave 3.0.1.262: 122 Nodes on one Z-Net

              Comment


              • #67
                Have not -
                I had one script running every 5 minutes that I disabled on 2/23 - (data scraper). I don't plan any other changes until some more time passes.

                Comment

                Working...
                X