LC Garbage Collection?

Tom Glod tom at makeshyft.com
Tue Sep 24 16:43:47 EDT 2019


HH...yup I know...... Dar, thanks for those hints and tidbits, I'll be
putting those right into my pocket as i optimize code going forward.

I have pretty good cleanup habits, so  I am getting good results with how
it is (in 9.05) ..... but sometimes its scary.  It like the GC happens only
when things are idle and quiet....maybe there is a threshold.

When you say GUI recursion....do you mean,,,,if i draw interfaces using
functions that call themselves?

On Tue, Sep 24, 2019 at 3:40 PM Dar Scott Consulting via use-livecode <
use-livecode at lists.runrev.com> wrote:

> I don't know where you will find details. (Maybe if we keep this
> conversation going, we will get a response in a half day.)
>
> I believe it is reference-counting with lazy cleanup for high-level
> objects, but with carefully crafted destructors for low level objects.
> Because of the lazy cleanup, it is sometimes hard to see when memory
> problems occur or to infer GC behavior
>
> But, to me it doesn't matter. I like the memory management of LiveCode. It
> cleans up. It doesn't have astonishingly-long pauses that I remember. It
> would be nice to know that cleanup is not delayed forever, though, and for
> that I am not sure. I have only run into memory problems with some ML
> projects, so my experience might not shed much light.
>
> Sources of memory leaks are LC, LC scripts, OS, libraries, LCB and (I
> suppose) compilers. I don't think we can assume the problem is not in the
> user script. I have seen script memory leaks like these:
> 1. Leaving large data in script locals
> 2. Indefinite log variables
> 3. Poor range checking in recursive functions
> 4. mouseUp recursion*
> 5. Queue/stack bugs
> 6. Bad parsing
>
> *GUI recursion is a root of all kinds of evil. If tempted, leave your
> cloak and run.
>
> Dar Scott
> Mad Scientist
>
> > On Sep 24, 2019, at 12:36 PM, Tom Glod via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> > Hi folks, I'm wondering if anyone can help me to understand Livecode's
> > garbage collection.  I am developing an application that is intended to
> > stay in memory and so I must watch memory consumption carefully. I've had
> > some instances where memory ran way out of control.... but I found a
> couple
> > of reasons for that...... one of them being the dozen or so memory leaks
> > that were fixed in 9.05.
> >
> > When I build the standalone in 9.04 its a disaster. When I build with
> 9.05
> > I am very impressed with my application clearing its own memory..... even
> > to the point where it consumes less than what it does when the standalone
> > first starts up
> >
> > But it seems arbitrary.  Where can I go to find out more details about
> the
> > engine's GC?
> >
> > Thanks,
> >
> > Tom Glod
> > Founder & Developer
> > MakeShyft R.D.A (www.makeshyft.com)
> > Office:226-706-9339
> > Mobile:226-706-9793
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Tom Glod
Founder & Developer
MakeShyft R.D.A (www.makeshyft.com)
Office:226-706-9339
Mobile:226-706-9793



More information about the use-livecode mailing list