Code size limit in 1.6? Unable to compile app

mistermentality

Active Member
Licensed User
Longtime User
I bought 1.6 today to upgrade from 1.4 and just cannot compile my app that was fine compiling under 1.4 earlier.

It has 2761 lines of code, it is the only one of my apps that will not compile (my other apps are a lot smaller). The compilation times out so I have increased the timeout value by a minute each time until even at nine minutes it times out. On the rare occasions it does not time out I get a top level error about running out of memory.

I changed the memory from 512 to 1024 for the dex and it has made no difference. My computer cpu usage rockets to 100% where it stays most of the time and my used ram goes from around 900 mb to 1.8 Gb which makes the computer unusable.

I have to stress my other apps compile fine just not this one, which leads me to ask is it a file size issue because I have a lot of lines of code?

If so how can I revert to 1.4, if I un install and wipe the program files folder will that do it or will I need to locate a registry key?

I really don't want to revert but I don't think I have a choice unless can have old and new version side by side which I don't think is possible :(

Dave

Edit: correction the time was five minutes (I double checked again as had changed it to nine at one point ) but there seems to be a reproducible bug.

If I set the timeout to five minutes it compiles but then the b4a ide was all greyed out and buttons missing meaning it could not be used and had to be closed with the x in the top right of the program. I tried again and whenever the timeout is set to a long time and does compile the same thing happens. I have found my app will actually compile now after four minutes and thirty seconds but the b4a ide has to be closed every time and restarted.
 
Last edited:

mistermentality

Active Member
Licensed User
Longtime User
I will try that later when I can as not able to right now but hopefully that will help, thanks :)

I have a two gigabyte dual core laptop (it's only 1.66 ghz but did not have a problem with 1.4) and can the cpu spike and memory usage peak happen when the compilation process is underway.

I can confirm that whenever this happens the tool bar in the ide is greyed out and can only be exited with the close window x as it happens every time. I use my laptop for programming and browsing the net so it hasn't had any new programs installed for at least the past three weeks except for new b4A and the memory issue only happens with compilation of that one app not any others.

It seems to happen specifically when compiling, under 1.4 the app compiled quickly (it sometimes timed out but would compile within a minute) but for some reason version 1.6 just does not like the same application code which is mostly simple text replace statements.

The laptop runs windows seven starter and only has antivirus and default windows programs in background, and has windows superfetch set to 3 and windows enable prefetch set to 3 but these settings are the default ones.

Dave

Edit: Although I am going out soon so cannot experiment at the moment I have just disabled the attach debugger option and tried compiling twice. Both times it compiled within three minutes with no timeout, cpu usage was still 100 % from the first thirty seconds or so until completion but memory usage went from 780 Mb to a maximum of 1.38 Gigabytes so it has made a difference somehow. I will try later with the avd running as I usually have that running but it seems to have worked.

The cpu usage issue may have been present already with previous version, I never had to check because the apps always compiled very quickly so it may be that the much longer code along with the addition of the debugger attachment made it it take much longer and use up the extra memory?
 
Last edited:

mistermentality

Active Member
Licensed User
Longtime User
FWIW, my current app has over 9000 lines of code and it has no problem compiling under 1.6 to an Android 2.2 device, an Android 3.1 device, or various sized emulators.

Thank you, I have no idea why this particular app had trouble compiling and of course I may have a less powerful system than yourself but it is compiling with the debugger not being attached although obviously still with the problems mentioned in the first post.

But I can now compile the app :)

Dave
 

priusfan

Member
Licensed User
Longtime User
bonjour,
FYI, I met the same kind of problem, it was solved the same way : no debug infos.

after looking at the generated source,
I believe the reason is in the name of some vars used for debugging going in conflict with names used in the application.

For me the origin of conflict was with arrays and "_" in names....
 

mistermentality

Active Member
Licensed User
Longtime User
I can't say if that was the cause but can confirm my buttons and a number of variables did have _ characters in their names though didn't use any arrays.

Dave
 

JOTHA

Well-Known Member
Licensed User
Longtime User
... same problem!

It was the same to me!

I couldn´t save the code nor compile it and after that all the modules are gone LOST! :confused:

... but I had a saved code from 6 hours before, that was my luck.
So just 6 hours work are gone, but thats enough. :(

In the future I should not use the "_".

@ Erel: Is it a bug? :confused:
 

JOTHA

Well-Known Member
Licensed User
Longtime User
Hi Erel,

thank you for the answer.

I don't think that there is an issue with underscores.
With "underscores" you mean "_"?
I prefer to use them because the structure of the words is more efficient to read them later.

The debugging code can add some overhead to the compile time. Removing it will make your applications compile faster.
... I compiled without debugging mode. Is that the reason?

Even if compilation failed due to timeout you should still be able to save your project.
Maybe I had another problem with the computer (RAM or another program at runtime) ...

Thank you for your support!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
With "underscores" you mean "_"?
I prefer to use them because the structure of the words is more efficient to read them later.
Yes. There should be no problem using underscores (Basic4android doesn't allow you to use an underscore as the first character of an identifier, but this is not relevant for this issue).
 

JOTHA

Well-Known Member
Licensed User
Longtime User
Yes. There should be no problem using underscores (Basic4android doesn't allow you to use an underscore as the first character of an identifier, but this is not relevant for this issue).

Thank you Erel, so I use the underscores ("-") again all the time. ;)
 
Top