This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Memory Usage
#1
Sad 
Hello!

I'm have a problem with the memory load/usage on my LM Ambient.
Whenever i reset the LM Ambient, the Memory load is around 15-19%, but each day it increases by 2-4%. 
A few days ago the load was at 90%, so I tried installing the newest firmware, but the same thing keeps happening.

Is there a possibility that any of my scripts could be causing this? I'm relatively new to LUA so it would be fair to assume that this might be of my own doing!

Some additional info

I have attached my trend logs.
No object logs are active.
I'm only using Z-Wave products, about 40 of them are connected to my LM.

A function/user.library that is called every 1 second for 4 different light zones in the same resident script

Code:
function auto_lysstyring(auto_on, nattsenking, sensor, light_type, light_control, dim_value_day, dim_value_night, off_time)

 
 if grp.getvalue(auto_on) == true then

 
    offtime = off_time -- Tid i minutter for å slå av lys etter siste bevegelse
    dim_day = dim_value_day -- Dimmeverdi på dagtid
    dim_night = dim_value_night -- Dimmeverdi etter nattsenking

    nattsenk = grp.getvalue(nattsenking) -- Henter nattsenk status true/false
    mov_sensor = grp.getvalue(sensor) -- Sjekker bevegelse i rommet
 light_type_check = light_type
 light_control_check = grp.getvalue(light_control)

 obj_find = grp.find(sensor)
    delta = os.time() - obj_find.updatetime


 
 
   if light_type_check == 1 then -- Light type 1 for dimming
     if mov_sensor == true then
       if light_control_check < 10 then
         if nattsenk == true then
           grp.update(light_control, dim_night)
           elseif nattsenk == false then
           grp.update(light_control, dim_day)  
         end  
       end
     end
     
     if mov_sensor == false and delta >= offtime * 60 then
       if light_control_check > 0 then
         grp.update(light_control, 0)  
       end
     end
   end
   
   if light_type_check == 0 then -- Light type 1 for av/på
     if mov_sensor == true then
       if light_control_check ==false then
         grp.update(light_control, true)  
       end  
     end
     
     if mov_sensor == false and delta >= offtime * 60 then
       if light_control_check == true then
         grp.update(light_control, false)
       end
       
     end
     
   end
   
 else
 end
 
end

A resident script that runs every 5 seconds
Code:
obj_find = grp.find('1/1/35') -- Gesture sensor value
delta = os.time() - obj_find.updatetime




if delta >= 5 and delta < 9.99 then
 gesture = grp.getvalue('1/1/35')
-- Green light, ECO Mode. Sets thermostats to ECO and turns off all lights
if gesture == 1 then
 
 -- upate HVAC MODE to ECO
 grp.update('1/1/66', 3)
 
 -- Turn off all lights
 bit_objects = grp.tag('ALT_AV_BIT')
    byte_objects = grp.tag('ALT_AV_BYTE')
 for index, value in ipairs(bit_objects) do
     grp.update(value.address, false)
    end

    for index, value in ipairs(byte_objects) do
     grp.update(value.address, 0)
    end
 
end

-- Orange light, Comfort mode. Sets thermostats to Comfort, lights are untouched.
if gesture == 2 then
 -- upate HVAC MODE to Comfort
 grp.update('1/1/66', 1)
end

-- Black Light, turns off all lights.
if gesture == 3 then
 -- Turn off all lights
 bit_objects = grp.tag('ALT_AV_BIT')
    byte_objects = grp.tag('ALT_AV_BYTE')
 for index, value in ipairs(bit_objects) do
     grp.update(value.address, false)
    end

    for index, value in ipairs(byte_objects) do
     grp.update(value.address, 0)
    end
 
end

-- yellow Light, turns on all lights.
if gesture == 4 then
 -- Turn off all lights
 bit_objects = grp.tag('ALT_AV_BIT')
    byte_objects = grp.tag('ALT_AV_BYTE')
 for index, value in ipairs(bit_objects) do
   grp.update(value.address, true)
    end

    for index, value in ipairs(byte_objects) do
     grp.update(value.address, 90)
    end
 
end
end
A resident script that runs every 60 seconds
Code:
-- get an array of objects tagged 'tag name'
myobjects = grp.tag('Battery')
batteryfails = 0

-- arraytable = { 'a', 'b', 'c' }
for index, value in ipairs(myobjects) do
 batterycheck = grp.getvalue(value.address)
 if batterycheck < 10 then --rapporterer alle batterier under 10%
   batteryfails = batteryfails + 1

end
 

 
end



if batteryfails > 0 then
       grp.update('1/1/105', batteryfails)
 grp.update('1/1/104', true)
elseif batteryfails == 0 and grp.getvalue('1/1/104') == true then
 grp.update('1/1/105', batteryfails)
 grp.update('1/1/104', false)
end

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Memory Usage - by Krstfr2k - 12.09.2017, 06:49
RE: Memory Usage - by admin - 12.09.2017, 09:00
RE: Memory Usage - by Krstfr2k - 12.09.2017, 09:19
RE: Memory Usage - by admin - 12.09.2017, 10:53
RE: Memory Usage - by Krstfr2k - 12.09.2017, 11:37
RE: Memory Usage - by admin - 12.09.2017, 11:50

Forum Jump: