Re: What are possible reasons for memory consumption ...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: What are possible reasons for memory consumption ...

Mike Kerner via use-livecode
To help determine if Brian's suggestion is occurring, you could put the following line in your "self perpetuating" code (assuming you're not running the code on a Mobile device which have no "messsage box") just before the "send... in x time ":

put the pendingmessages

If you see ANY output, then you've got multiple overlapping messages ... again, this assumes you only have ONE "loop" running.  Perhaps you can send the "offending" section of code for analysis?

Douglas Ruisaard
Trilogy Software
(250) 573-3935

>
> Is it possible that multiple overlapping messages are being spawned?
>
> You mention that the checks happen every 250ms... are you doing a send in time at the end of the check
> or at the start?
>
> Thanks,
> Brian
> On Jul 7, 2018, 7:21 PM -0400, Tom Glod via use-livecode <[hidden email]>, wrote:
> > So i've been watching this running standalone a while .... and it
> > seems to have stopped for now...I'm going to keep it running and see
> > how high up it gets.
> >
> > Its like the engine is caching system events or something .... I'll
> > post again in a few hours to see if its gotten any higher than this.....
> >
> > On Sat, Jul 7, 2018 at 7:15 PM, Tom Glod <[hidden email]> wrote:
> >
> > > Hi folks,
> > >
> > > I have a stack that has 2 or 3 self perpetuating messages which do a
> > > few checks and the like....they run every 250 milliseconds or so.
> > >
> > > There is no input data into the program unless I specifically send
> > > it there.
> > >
> > > but while my program is sitting there ....repeating its loops and
> > > checks for incoming input ...... the memory consumption is steadily
> > > going up by .1 megabytes at a time.
> > >
> > > I have watched my global variables , there is nothing being added to
> > > them and most handlers have local variables that clear out when the
> > > handler finishes.
> > >
> > > This happens in IDE and standalone.
> > >
> > > This app is made to stay in memory so this is not acceptable,
> > > because after 2 days it will get up to 2gb or whatever....so i
> > > cannot let this remain.
> > >
> > > maybe if i let it sit there it will eventually clear out ..but i
> > > haven't seen that happen yet.
> > >
> > > I just don't know where to look. maybe i just found a memory leak
> > > ....Thanks for any input
> > >


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: What are possible reasons for memory consumption ...

Mike Kerner via use-livecode
Or alternatively, check the pendingmessages and only send if there is not
already a message for the handler in question in queue.

I've had situations (in my case, bad coding) where I thought I was starting
a looping handler once ,but had left a call to that handler elsewhere
accidentally during the re-think process.  In those cases, even if it is a
seldom run handler that has the mistake, every time it is called, a new
instance of the loop starts.  In my case, (since I have trouble tracking
details as complexity grows beyond a certain point.. Small scale I'm great,
large scale, not so much) I've just made it a habit to always do the
pendingmessage check before sending again.  (I have lots of little rules
like this to help me manage my own personal limitations in a consistent
way.. Like always including a way to exit a tight repeat loop during
development at least, to avoid issues with runaways.)

Hmm. I tend to run on about things lately don't I?  Feel free to ignore any
extraneous blab.

On Sun, Jul 8, 2018 at 10:42 AM Douglas Ruisaard via use-livecode <
[hidden email]> wrote:

> To help determine if Brian's suggestion is occurring, you could put the
> following line in your "self perpetuating" code (assuming you're not
> running the code on a Mobile device which have no "messsage box") just
> before the "send... in x time ":
>
> put the pendingmessages
>
> If you see ANY output, then you've got multiple overlapping messages ...
> again, this assumes you only have ONE "loop" running.  Perhaps you can send
> the "offending" section of code for analysis?
>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: What are possible reasons for memory consumption ...

Mike Kerner via use-livecode
On 7/8/18 12:06 PM, Mike Bonner via use-livecode wrote:
> Or alternatively, check the pendingmessages and only send if there is not
> already a message for the handler in question in queue.

Like you, this is something I always do:

if "myMsg" is not in the pendingMessages then
   send "myMsg" to me in 250 milliseconds
end if

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: What are possible reasons for memory consumption ...

Mike Kerner via use-livecode
Hi Douglas and Jaquie.... thank you for your input..I have double checked
my code and indeed my loop is safe from overlapping messages....I've been
working with schedulers for a while...  still not sure what could be
causing it..but it doesn't seem to get out of hand and clears itself out
periodically and returns to its base consumption (assuming no input).

thanks again

On Sun, Jul 8, 2018 at 3:05 PM, J. Landman Gay via use-livecode <
[hidden email]> wrote:

> On 7/8/18 12:06 PM, Mike Bonner via use-livecode wrote:
>
>> Or alternatively, check the pendingmessages and only send if there is not
>> already a message for the handler in question in queue.
>>
>
> Like you, this is something I always do:
>
> if "myMsg" is not in the pendingMessages then
>   send "myMsg" to me in 250 milliseconds
> end if
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode