Memory exhausted

Moderators: LCMark, LCfraser

Post Reply
pink
Posts: 249
Joined: Wed Mar 12, 2014 6:18 pm

Memory exhausted

Post by pink » Mon Apr 08, 2019 11:38 am

So I programmed an LCB library full of SVG icons from Icon54. It is huge, the library is around 7700 lines long.

At around line 7562 I received the error "Parsing error: memory exhausted"

So my question is, what are the limitations of an LCB library, and if I scaled back a little and successfully, how would it effect any builds that I created with it included? Would it seriously slow down the program or possibly have a dramatic influence of how much RAM and/or processing power needed?

Would it make more sense to make this into an LCS library, and load in smaller chunks when needed? Will I run into similar memory issues with it?
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6713
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Memory exhausted

Post by FourthWorld » Mon Apr 08, 2019 3:50 pm

~8k lines of text is not the problem. LC 9.x has addressed some memory leaks. Try the latest version and report back if the problem persists.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

pink
Posts: 249
Joined: Wed Mar 12, 2014 6:18 pm

Re: Memory exhausted

Post by pink » Tue Apr 09, 2019 12:42 am

Happens in 9.0.2, 9.0.3, 9.0.4-RC2

Also, I forgot to mention, after this happens, if I try and save an open stack I get :

"Can 't save stack {STACKNAME} due to an error: can't open stack file"
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1015
Joined: Thu Apr 11, 2013 11:27 am

Re: Memory exhausted

Post by LCMark » Wed Apr 10, 2019 12:05 pm

@pink: That error is generated by the lc-compile command-line tool which compiles lcb into modules. The error you are getting typically arises if you have a single handler with a very large number of commands in it (it's a limitation of the parser generator we use for the LCB parser). You can avoid the issue by splitting the handler up into several shorter handlers.

We had to do this for the iconSvg library which is shipped with the IDE:

https://github.com/livecode/livecode/bl ... consvg.lcb

Here you can see the fontawesome library has been setup by splitting into two handlers.

pink
Posts: 249
Joined: Wed Mar 12, 2014 6:18 pm

Re: Memory exhausted

Post by pink » Wed Apr 10, 2019 3:38 pm

that makes total sense, will give that a try

Thanks!
LCMark wrote:
Wed Apr 10, 2019 12:05 pm
@pink: That error is generated by the lc-compile command-line tool which compiles lcb into modules. The error you are getting typically arises if you have a single handler with a very large number of commands in it (it's a limitation of the parser generator we use for the LCB parser). You can avoid the issue by splitting the handler up into several shorter handlers.

We had to do this for the iconSvg library which is shipped with the IDE:

https://github.com/livecode/livecode/bl ... consvg.lcb

Here you can see the fontawesome library has been setup by splitting into two handlers.
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

pink
Posts: 249
Joined: Wed Mar 12, 2014 6:18 pm

Re: Memory exhausted

Post by pink » Wed Apr 24, 2019 3:43 pm

For the record breaking them up to smaller functions did the trick.
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

Post Reply

Return to “LiveCode Builder”