Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 9th, 2025, 10:56 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Variable Memory Leak?
PostPosted: March 15th, 2009, 10:10 am 
Offline

Joined: June 9th, 2008, 7:37 am
Posts: 79
Location: Kent, UK
Hi, if a variable is created in script using the VAR statement, and this script is run using a ticker trigger, will this cause a memory leak? Would it be better practice to create the variable just once in the publication properties, rather than create it each time the script is run?

Many thanks, Kurt

_________________
Opus Pro 7.04
Windows XP SP3
2GB
Athlon II X2 1.6GHz
ATI RAdeon HD 3200


Top
 Profile  
 
 Post subject:
PostPosted: March 15th, 2009, 7:39 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
A single variable will use a fixed amout of resource when it is allocated. If it is used with a ticker, the variable is just re-used, so it should not create a 'memory leakage' problem. If you create a new variable each run of the ticker...var1, var2, var3, then it will use increasing amounts of memory.


Other things about tickers...... What you do have to be careful of is having a ticker run so fast it uses an unnecessary amount of resources. Opus will eat system resources (processing power) if you have a lot going on.
You have to also bear in mind if you are accessing a database from a ticker, it may take longer for the database to respond that the ticket time, Opus will not know that a response is expected, so you should test for a response.
If you put a 2 second delay in a 0.1 second ticker, Opus will wait for the 2 second delay, so the ticker will not be able to run at 0.1S.
Choose a ticker value time is just as long as it needs to achieve what it does, but not much faster. If the actions/script is longer than the ticker time, then that will determine the time.
If the programming/delay is just a wee bit longer than the ticker time, the ticker will not simply start the next period as soon as it can, it will wait until the start of the next ticker period....if you follow?

....how to be a ticker bore in one easy lesson!!

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: March 16th, 2009, 8:59 am 
Offline

Joined: June 9th, 2008, 7:37 am
Posts: 79
Location: Kent, UK
That's great, thanks Sandy, I use the same variable for every tick, so it shouldn't be a problem, although I will tidy up the script later.

Many thanks, Kurt

_________________
Opus Pro 7.04
Windows XP SP3
2GB
Athlon II X2 1.6GHz
ATI RAdeon HD 3200


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2009, 2:27 pm 
Offline

Joined: February 5th, 2006, 3:39 am
Posts: 55
Location: Scotland
sandyn wrote:


....how to be a ticker bore in one easy lesson!!


Hi Sandy,

I have not been on for a long time but the last time I was on, you were helping me. I see nothings changed.

Your "lessons" are much appreciated and always welcome.

Your not a bore!!

_________________
Opus Pro 6 on Windows 2000 with 2gb Ram
Working on a large intranet!


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2009, 10:30 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I'm still alive and................ticking........and my jokes never get any better!!

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group