I've come across a few different threads now that have tracked down memory leaks to their .cs scripts. Is anything being done about fixing this problem?
I too am having the same problems that completely go away when disabling a simple cs script I wrote.
Homeseer crashes every 1 to 2 days. I see tons of "out of memory" errors show up in the log prior to it crashing. Then i'll get an error report that looks something like this:
I don't think this error report has much to do with the problem itself. i think HS3 just craps out because of the memory issues.
I have 386 gigs of available disk space, and 16 GB ram. This should NOT be happening. The machine itself remains completely stable. No resource issues. I just have to kill HS3 and restart it and everything works again for a day or two.
The script i'm using looks like this:
To be clear, the threads I read indicated that the same code translated to vb scripts did not cause problems for those people, but as cs scripts, they saw memory leaks.
Garbage collection or something must not working for cs scripts. Please confirm that someone knows about this and is doing something to fix it. This is a serious problem.
I too am having the same problems that completely go away when disabling a simple cs script I wrote.
Homeseer crashes every 1 to 2 days. I see tons of "out of memory" errors show up in the log prior to it crashing. Then i'll get an error report that looks something like this:
Code:
11/3/2016 8:51:47 PM Not enough storage is available to process this command HomeSeer version: 3.0.0.297 Source: System Target: Boolean StartWithShellExecuteEx(System.Diagnostics.ProcessStartInfo) Stack trace: at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at HS3.Form1.btnStartupLog_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.PerformClick() at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.PreProcessMessage(Message& msg) at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg) Please specify what you were doing at the time of this error:
I have 386 gigs of available disk space, and 16 GB ram. This should NOT be happening. The machine itself remains completely stable. No resource issues. I just have to kill HS3 and restart it and everything works again for a day or two.
The script i'm using looks like this:
Code:
// Arg 1 - Device ID with on/off dictating whether to control light or not // Arg 2 - Device ID with desired light level // Arg 3 - Device ID with natural Lux level // Arg 4 - Max Lux level before turning on light // Arg 5 - comma sep. list of lights to control public void Main(Object[] args) { char[] argDelimiterChars = { '|' }; string[] args_arr = args[0].ToString().Split(argDelimiterChars); int shouldControl = hs.DeviceValue(Int32.Parse(args_arr[0])); if(shouldControl == 1) { int natLuxLevel = hs.DeviceValue(Int32.Parse(args_arr[2])); int maxLux = Int32.Parse(args_arr[3]); if(natLuxLevel < maxLux) { int desiredLightLevel = hs.DeviceValue(Int32.Parse(args_arr[1])); int lightId = 0; char[] lightDelimiterChars = { ',' }; string[] lights = args_arr[4].ToString().Split(lightDelimiterChars); foreach (string i in lights) { lightId = Int32.Parse(i); HomeSeerAPI.CAPI.CAPIControl cc = hs.CAPIGetSingleControl(lightId, true, "Dim (value)%", false, false); cc.ControlValue = desiredLightLevel; HomeSeerAPI.CAPI.CAPIControlResponse cr = hs.CAPIControlHandler(cc); } // end foreach } // end if natLuxLevel } // end if should control }
Garbage collection or something must not working for cs scripts. Please confirm that someone knows about this and is doing something to fix it. This is a serious problem.
Comment