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

Allow to override the 1:1 ratio between Xmx & off-heap amount? #8435

Closed
maxime-michel opened this issue Nov 22, 2019 · 3 comments
Closed

Allow to override the 1:1 ratio between Xmx & off-heap amount? #8435

maxime-michel opened this issue Nov 22, 2019 · 3 comments
Assignees
Labels
DL4J General DeepLearning4j issues Enhancement New features and other enhancements

Comments

@maxime-michel
Copy link
Contributor

maxime-michel commented Nov 22, 2019

Issue Description

We ship DL4J in a web application deployed by our users on instances of various sizes.

Also, our application uses the library minimally, the 1:1 ratio between Xmx and Dorg.bytedeco.javacpp.maxbytes is excessive.

If you don’t specify off-heap memory limit, the JVM heap limit (Xmx) will be used by default.

An instance's usage of the library depends however on the application's number of users. So, we might allocate 512MB for a 4GB instance with 5 concurrent users, but that number would have to grow linearly for an Xmx of 16GB.

Instead of us providing documentation about example scenarios to every single system administrator, we would rather be able to pass a parameter that would define which ratio of Xmx DLF4J should use across the board. For instance, 0.1.

Contributing

We are happy to work on this should the feature make sense to you.

@saudet saudet self-assigned this Nov 23, 2019
@saudet saudet added DL4J General DeepLearning4j issues Enhancement New features and other enhancements labels Nov 23, 2019
@saudet
Copy link
Contributor

saudet commented Nov 23, 2019

It should be easy enough to add something for that around here: https://github.com/bytedeco/javacpp/blob/master/src/main/java/org/bytedeco/javacpp/Pointer.java#L455-L477
Maybe something like "org.bytedeco.javacpp.maxMemoryRatio"? In any case, please do send a pull request with modifications that satisfy your requirements! Thank you

@saudet
Copy link
Contributor

saudet commented Dec 5, 2019

Done! Thanks for the contribution and for hanging in there to narrow down the requirements.

@saudet saudet closed this as completed Dec 5, 2019
@maxime-michel
Copy link
Contributor Author

Thanks for your patient help and input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DL4J General DeepLearning4j issues Enhancement New features and other enhancements
Projects
None yet
Development

No branches or pull requests

2 participants