Other Project size limits?

Alessandro71

Well-Known Member
Licensed User
Longtime User
every now and then, I stumble upon some size limit
and I hit a similar one in a code module with no try/catch at all

since my project is growing larger every day (actually 170 files, 3MB source code) I'm worried about hitting some hard limit later on in development

is there any reference to limits/constraints of the B4X platform?
 

alwaysbusy

Expert
Licensed User
Longtime User
Most likely it is just a method that has grown to big, not the overall project. You should split it up in sub methods. I had it recently also in a REST API processor method that processed a lot of sub paths. I just made separate subs for each path and called them in the main sub and the problem went away. I think one method can only have about 64K characters and with debugging enabled, your code is twice the size of your code at compiling because it also has to inject debugging lines in the java code. So sometimes it does work in release mode, but is to big in debug mode.
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
I solved that specific issue just by splitting code, as you described, but I’m worried about limits that I may not have met yet.
What if, for example, a project would be limited to 255 files, or classes?
I just would like to know that in advance.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Most likely it is just a method that has grown to big, not the overall project. You should split it up in sub methods. I had it recently also in a REST API processor method that processed a lot of sub paths. I just made separate subs for each path and called them in the main sub and the problem went away. I think one method can only have about 64K characters and with debugging enabled, your code is twice the size of your code at compiling because it also has to inject debugging lines in the java code. So sometimes it does work in release mode, but is to big in debug mode.
That's correct.

There is no limit to the project size. Very large subs can reach a Java compiler limit in debug mode.
 
Upvote 0
Top