PackageCompiler app using a lot of RAM

I created an App via PackageCompiler.jl, but running the app is using way more memory than what is used with the code running in the REPL. I removed all using statements from my code and only import what’s necessary. Additionally I tried to create the App with the option include_transitive_dependencies=false, but still a lot of memory usage.

The binary itself ends up with almost 4GB, and when I run it, memory usage goes to the limit of my hardware, at 24 GB.

What should I do to debug this issue?

Here is the related discussion from github and the workflow on optimising code. Cheers.

Thanks for the response. Their discussion is about the memory usage during the creation of a sys image. I can create the app just fine, the memory usage problem happens when I try to run the binary generated by the PackageCompiler. About the second link, the code I wrote has good performance running on the REPL, with a reasonable amount of memory usage for the problem I’m testing. I’m not sure why it would run fine on the REPL and require more than 5 times more memory when running the same code through the generated binary.

I solved it. I forgot to mention that I use CUDA.jl in my app, and I’m experiencing this issue. Reverting to CUDA.jl v5.4.3 stopped the explosive RAM usage.

2 Likes