AL
AL copied to clipboard
System.OutOfMemoryException when trying to build & publish app
Describe the bug We're in the process with the whole development team to split up our solution into multiple apps, but things are going really slowly because of this error occuring time and time again.
When trying to build & publish our app for the second time during a VS Code session (because of ongoing development) a System.OutOfMemoryException occurs
To Reproduce Steps and to reproduce the behavior:
- Open VS Code
- Open a workspace with the app (in our case +/- 4300 source files)
- Press F5 to build & publish
- Check some functionality
- Back to VS Code and stop debugger
- Make some changes to the code
- Press F5 again to build & publish
- Error occurs
Update: This only occurs if the "features" property in the app.json file is set to "TranslationFile" But of course this is only a workaround
Expected behavior Even after disabling a lot of VS extensions en changing settings in VS Code to boost performance, it presents this issue. We need to be able to trust AL en VS Code to work smooth and properly without out-of-memory exceptions.
Screenshots
5. Versions:
- AL Language: 5.0.280447
- Business Central: 16.0.13440.13772 (OnPrem)
Hi @ptijsma, thank you for reporting the issue. Could you please provide a project which demonstrates the issue, may be it is possible to localize the problem. It would significantly help us to reproduce the issue. What kind of changes do you make at i.6, does the translation file has any changes between ii.3 and 7? Thank you.
Hi @AndreyKorepanov,
Provide a project.. Ehhm.. I could provide you our App in a private message somehow, however, it's in total 249 MB and contains 4452 files.
Regarding the translation files:
We have these translation files in the directory:
The BaseApp.g.xlf would normally be bigger, but beacuse the property "TranslationFile" has been disabled, this isn't rebuild currently
re/ Changes at i.6: Can be any change as simple as adding a MESSAGE somewhere. Nothing fancy re/ Translation file changes: We haven't made any changes to the en, nl, de translation files between i.3 and i.7. The only change (When the property "TranslationFile" has been enabled) is that the BaseApp.g.xlf is being rebuild on F5. To my understanding it's exactly the rebuild of BaseApp.g.xlf that causes the crash.
Hope this helps, Thanks, Peter
Hi @ptijsma, thank you for reply. I'll try to get a repro on the Base app, In my case Base app translation file is around 50K.
Hi @AndreyKorepanov ,
Just to be sure: BaseApp in our case, is our BaseApp which has of course a dependancy on the Microsoft BaseApp.
Hi @AndreyKorepanov ,
Just another few screen shots with different Out of memory exceptions. Same app. Not sure if this helps though.
Hi @AndreyKorepanov,
Just found out one more thing. Seems our generated Xlf files are also kind of corrupted... It seems there are quite some entries with duplicate id's:
I'm guessing this could also be some kind of reason for out of memory exceptions..
Hi @ptijsma, it seems the former is related to the #5866. Thanks.
@atoader @AndreyKorepanov
Do we have any resolution for this issue??
Use 64 bit compiler. It will be much faster and does not give out of memory exceptions
This error usually comes while building large applications/extensions.
When the memory usage for this process exceeds 4GB it throws out of memory because a 32 bit process can not use more than 4GB memory
@suryanshsangwan Is there a 64 bit compiler for AL available? If so, where would i find it?
@iTomate AL vscode extension is the compiler. When you extract it, you will find a win32 folder that contains the 64bit compiler and its dependencies.
We ran into simular problems when changing the BC18 baseapp. We are unable to compile the app: System.OutOfMemoryException
When deleting the xlf files from the Translations folder, compilation finishes succesfully.
@rcverbeek use this path to solve out of memory exception
Thats seems to be working quite well! Thanks a lot Suryansh
The 64 bit executable is shipped nowadays, so I'll close this