Memory exhausted

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
pink
Posts: 272
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: 9823
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

pink
Posts: 272
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: 1207
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: 272
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: 272
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”