Source language: Translate to:

memory issue

General questions about NeoBook

Moderator: Neosoft Support

memory issue

Postby frednet » Mon Jan 13, 2014 3:57 am

I'm running a pub to measure temperatures 24/7. the pub logs data from two different sources. One involves the velleman pluging Hans-Peter and David kindly helped with. The memory problem I have is not related to this part of the logging because the problem was already there before the Velleman hardware was implemented.
The problem is that something is eating my memory. It eats away memory at a rate of 10 mb/ hour.
It is very wel possible the loss is not related to Neobook or my somewhat limited programming skills.
The problem could be related to the Digitemp.exe that is called from within Neobook. This is the code I use;
Code: Select all
:leesdigitemp
.empty input file
FileWrite "[naaminputfile]" "All" ""
. measure temperatures and put data in inputfile
Run "digitemp" "-o2 -a -q -l[naaminputfile]" "RunOnce+Wait+Hidden" "" ""
Delay "200"
FileRead "[naaminputfile]" "1" "[digitempwaarde]"
Return

I declared variables at the beginning of the pub, but perhaps the code i have written is sloppy.
Is it alright to put the main routine up here for evaluation? I do not want to spoil bandwidth.
are there doe's and don't s related to memory loss in Neobook?
Regards Fred.
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: memory issue

Postby dec » Mon Jan 13, 2014 8:04 am

Hello,

Since I can't remember hear in this forum that NeoBook publications "eating memory", I think more reasonable to think that the problem can come from the "digitemp.exe" program. Maybe can you try "commenting" all the actions except the "Run" one? This maybe put in evidence the "digitemp.exe" program. Maybe this program accept some other arguments in order to tell him "free the memory when finish"?

I think to upload a publication sample can be good, ever than we can try it in our computers in order to test it.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: memory issue

Postby HPW » Mon Jan 13, 2014 8:29 am

Hello,

I would create a batch file with a hundred calls and a delay between the calls to simulate the neobook calling and would check if this standalone eats memory.
Then you know if this makes the problem.

Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: memory issue

Postby Neosoft Support » Mon Jan 13, 2014 11:06 am

You might also tale a look at the Windows Task Manager and see if there are multiple copies of digitemp.exe running. The "RrunOnce" option requires some cooperation from the program and may not work for everything. That might explain the memory loss.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: memory issue

Postby dec » Mon Jan 13, 2014 11:18 am

Neosoft Support wrote:You might also tale a look at the Windows Task Manager and see if there are multiple copies of digitemp.exe running. The "RrunOnce" option requires some cooperation from the program and may not work for everything. That might explain the memory loss.


+1
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: memory issue

Postby frednet » Mon Jan 13, 2014 2:19 pm

dec wrote:Hello,

Maybe can you try "commenting" all the actions except the "Run" one? This maybe put in evidence the "digitemp.exe" program. Maybe this program accept some other arguments in order to tell him "free the memory when finish"?
.


By commenting you mean skipping the commands?
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: memory issue

Postby dec » Mon Jan 13, 2014 2:41 pm

frednet wrote:
dec wrote:Hello,

Maybe can you try "commenting" all the actions except the "Run" one? This maybe put in evidence the "digitemp.exe" program. Maybe this program accept some other arguments in order to tell him "free the memory when finish"?
.


By commenting you mean skipping the commands?


Yes; but not the "Run" command. The idea is to try to isolate the "problem" into the "Run" command, and probably into the "digitemp" executable. In other words, try to looking if we can do something to workaround the commented command if the problem is caused by them.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: memory issue

Postby frednet » Mon Jan 13, 2014 3:41 pm

Thanks for all input, it will take time to do the tests.
Task manager does not show multiple copy's of the digitemp.exe
After half a day performance monitor shows an increase in non paged memory.
also the number of free megabytes slowly shrinks and at about 10 mb left it crashes the system.
I have one 512mb system running 24/7 it restarts once every day.
I'll report back after testing, Thanks Fred.
Last edited by frednet on Sun Jan 26, 2014 1:57 pm, edited 1 time in total.
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: memory issue

Postby frednet » Thu Jan 16, 2014 4:07 am

First test result of running the digitemp.exe from a simple batch file shows a flat line on memory usage. After running it for two days its save to say that the digitemp exe is not the problem here. The next test is going to be running the publication without calling the digitemp exe. I'll keep you posted
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: memory issue

Postby Neosoft Support » Thu Jan 16, 2014 11:45 am

For your next experiment, you might try removing the "wait" option from the Run action that launches digitemp. If digitemp is a DOS program it may be that NeoBook can't detect when it closes and is waiting indefinitely. I'm not sure about this but it might be worth experimenting with different Run options to see if different combinations make any difference.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: memory issue

Postby frednet » Fri Jan 17, 2014 3:34 am

Neosoft Support wrote:For your next experiment, you might try removing the "wait" option from the Run action that launches digitemp. If digitemp is a DOS program it may be that NeoBook can't detect when it closes and is waiting indefinitely. I'm not sure about this but it might be worth experimenting with different Run options to see if different combinations make any difference.

I have tried removing the "wait" option but it does not have a positive effect. Neobook does a good job on detecting the end of the digitemp.exe. Execution time depends on the number of sensors and Neobook times accordingly. I'll do some experimenting with the other options.
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: memory issue

Postby frednet » Sat Jan 18, 2014 4:58 am

I have finished testing, no matter what option using the run command eats away all memory.
Are there anymore command options I could use?
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: memory issue

Postby dec » Sat Jan 18, 2014 6:35 am

Hello,

I don't know if the "DOSCommand" action, even when is marked as "obsolete" can be used here, thinking that maybe this action take another approach than the "Run" action. Other possible solution can be to prepare a "BAT" file which execute the "EXE", and then use the "Run" action to execute the "BAT" file instead the executable. Maybe this solution cannot solve the problem or other mate can provide another possible way to try.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: memory issue

Postby Gaev » Sat Jan 18, 2014 7:32 am

Fred:

I am assuming that you repeatedly call the SubRoutine called leesdigitemp.

If so, can you tell us ...

a) how you invoke it (please post the NeoBook code) ?

b) what code/logic you use to determine that the previous request was completed ?

c) how often (i.e. number of times per second/minute/hour) this SubRoutine is invoked

First test result of running the digitemp.exe from a simple batch file shows a flat line on memory usage.
Can you post the code you used in your BATch file ?

Finally, one more experiment you might try is to remove the FileWrite and FileRead commands from the SubRoutine ... just to see if "perhaps invoking these commands at a frequent rate causes the loss of available memory".
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: memory issue

Postby frednet » Sun Jan 19, 2014 5:50 am

Gaev wrote:Fred:
a) how you invoke it (please post the NeoBook code) ?
b) what code/logic you use to determine that the previous request was completed ?
c) how often (i.e. number of times per second/minute/hour) this SubRoutine is invoked


here is the gosub I use at the moment
Code: Select all
:leesdigitemp
.empty input file
FileWrite "[naaminputfile]" "All" ""
Delay "1000"
. measure temperatures and put data in inputfile
Run "digitemp" "-o2 -a -q -l[naaminputfile]" "RunOnce+Wait+Hidden" "" ""
Delay "1300"
FileRead "[naaminputfile]" "1" "[digitempwaarde]"
Return


b)the digitemp routine takes about 5 seconds to complete I ad some time to that, but even if I ad a five second delay extra it has no effect.
c) the subroutine runs every 10 seconds and ive also tried running it every twenty seconds.

this is the code of the batch file

Code: Select all
@echo off

cls
:start
echo dit is de volgende
digitemp.exe -o2 -a -q -lmeetgegevens.txt
ping localhost -n 10 >nul
goto start


Finally, one more experiment you might try is to remove the FileWrite and FileRead commands from the SubRoutine ... just to see if "perhaps invoking these commands at a frequent rate causes the loss of available memory".


I will set up a testpub in wich I remove everything but the basic digitemp loop and see what happens.

I'll gladly post all other code , but is severe digestable spagetty like :)

thanks Fred
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Next

Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron