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?
Memory exhausted
Memory exhausted
Greg (pink) Miller
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Memory exhausted
~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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Memory exhausted
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"
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
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
Re: Memory exhausted
@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.
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.
Re: Memory exhausted
that makes total sense, will give that a try
Thanks!
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
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
Re: Memory exhausted
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
MadPink, LLC
I'm Mad, Pink and Dangerous to Know