AL icon indicating copy to clipboard operation
AL copied to clipboard

System.OutOfMemoryException when trying to build & publish app

Open ptijsma opened this issue 4 years ago • 15 comments

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:

  1. Open VS Code
  2. Open a workspace with the app (in our case +/- 4300 source files)
  3. Press F5 to build & publish
  4. Check some functionality
  5. Back to VS Code and stop debugger
  6. Make some changes to the code
  7. Press F5 again to build & publish
  8. 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 image

5. Versions:

  • AL Language: 5.0.280447
  • Business Central: 16.0.13440.13772 (OnPrem)

ptijsma avatar Jun 16 '20 09:06 ptijsma

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.

AndreyKorepanov avatar Jun 18 '20 20:06 AndreyKorepanov

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: image

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

ptijsma avatar Jun 19 '20 08:06 ptijsma

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.

AndreyKorepanov avatar Jun 19 '20 09:06 AndreyKorepanov

Hi @AndreyKorepanov , Just to be sure: BaseApp in our case, is our BaseApp which has of course a dependancy on the Microsoft BaseApp. image

ptijsma avatar Jun 19 '20 09:06 ptijsma

Hi @AndreyKorepanov ,

Just another few screen shots with different Out of memory exceptions. Same app. Not sure if this helps though.

image

image

ptijsma avatar Jun 22 '20 13:06 ptijsma

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:

image

I'm guessing this could also be some kind of reason for out of memory exceptions..

ptijsma avatar Jun 29 '20 13:06 ptijsma

Hi @ptijsma, it seems the former is related to the #5866. Thanks.

AndreyKorepanov avatar Jun 29 '20 21:06 AndreyKorepanov

@atoader @AndreyKorepanov
Do we have any resolution for this issue??

ShivamG0217 avatar Aug 19 '21 12:08 ShivamG0217

Use 64 bit compiler. It will be much faster and does not give out of memory exceptions

suryanshsangwan avatar Nov 26 '21 11:11 suryanshsangwan

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 avatar Nov 26 '21 11:11 suryanshsangwan

@suryanshsangwan Is there a 64 bit compiler for AL available? If so, where would i find it?

thomari avatar Feb 18 '22 12:02 thomari

@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.

suryanshsangwan avatar Feb 18 '22 12:02 suryanshsangwan

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 avatar Mar 31 '22 10:03 rcverbeek

PXL_20220331_154150151.MP~2.jpg

@rcverbeek use this path to solve out of memory exception

suryanshsangwan avatar Mar 31 '22 10:03 suryanshsangwan

Thats seems to be working quite well! Thanks a lot Suryansh

rcverbeek avatar Mar 31 '22 10:03 rcverbeek

The 64 bit executable is shipped nowadays, so I'll close this

BazookaMusic avatar Mar 17 '24 22:03 BazookaMusic