Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAM consumption during compilation of vibe.d #1787

Closed
andre2007 opened this issue Jun 20, 2017 · 3 comments
Closed

RAM consumption during compilation of vibe.d #1787

andre2007 opened this issue Jun 20, 2017 · 3 comments

Comments

@andre2007
Copy link
Contributor

For the cloud platform "Cloud Foundry" I have written a D buildpack. That enables me to upload d source files to cloud foundry. The buildpack downloads dmd and executes dub to compile the source code to a linux executable which will afterwards be executed.
Each application in cloud foundry has an isolated environment and there are also restrictions like 1024 MB RAM.

While trying to upload d source code which uses vibe.d it fails. The upload silently fails while compiling vibe.d:http sub package. My assumption is 1024 MB RAM is not enough for compiling vibe,d.

One idea was to only specify the sub packages really needed in the dub dependencies section:
"dependencies": {
"vibe-d:core": ">0.8.0-beta.8",
"vibe-d:http": "
>0.8.0-beta.8"
},

But altough I specify these 2 sub packages only, all sub packages of vibe.d are compiled.

I am not sure whether you can do anything about this issue but I just wanted to notify you there is an issue with limited RAM while compiling vibe.d

@s-ludwig
Copy link
Member

This is strange, I was aware that memory consumption is barely acceptable in some cases, but it shouldn't build all packages when only code and/or http is referenced. 0.8.0 actually now has a pretty clean dependency structure. For which DUB version did this happen? Is there anything more to do to trigger this than "dub init" + adding the dependencies?

A possible way mitigate the memory consumption issue at the expense of increased build time would be to use --build-mode singleFile.

@andre2007
Copy link
Contributor Author

In a trace I now found this information:
vibe-d:http 0.8.0-rc.1: building configuration "library"...
Killed
dmd failed with exit code 137.

If I understand google correct, this means Linux has killed dmd due to the memory usage.
--build-mode singleFile has solved the issue.

I used dub included in 2.074.1 (linux) and it was just dub init and adding the dependencies.
I think I was wrong, although a lot of sub packages are compiled, not all sub packages are compiled.
But I think the issue is the size of the http sub packages, as the others before are compiled fine.

@andre2007
Copy link
Contributor Author

Dmd lowmem switch should solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants