-
Notifications
You must be signed in to change notification settings - Fork 4
Fix excessive memory allocation described in #4 #5
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
base: master
Are you sure you want to change the base?
Conversation
implementation argon2-jvm.
This looks more object-oriented and potentially reduces the number of pointer dereferences during bulk computation.
|
This is probably a tough PR to get merged seeing as this also includes changing from Maven to Gradle as well as many unrelated changes (rephrasing stuff in the readme, ...). |
|
|
||
| private boolean clearMemory = true; | ||
| private Charset charset = Charset.forName("UTF-8"); | ||
| private static Charset charset = Charset.forName( "UTF-8" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spaces preceding/following the brackets are really uncommon in Java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree. Adding an Eclipse auto-format save action to the project would help mimimizing those issues.
We (@dbusche and I) started evaluating, benchmarking and finally fixing the code from the latest version committed by @minebreaker, since it looked like a straight forward advancement (including hash encoding and cleanup). Don't know, why he did not post a pull-request. Yes, the readme was adjusted, since @minebreaker moved to Java 8, removed unneccessary dependencies for the command-line version (which I think is really not required for a crypto lib), and finally added this really usefull hash-encoding stuff. Therefore I consolidated the documentation reflecting the latest state. Yes, these changes are "unrelated" to the memory issue but If we started from the original @andreas1327250 code, the really useful @minebreaker stuff would have probably become unmergable. |
As described in #4 the hash computation allocates far to much temporary memory resulting in multiple GC runs per call. Especially f2d8b33 is critical to make the implementation usable in a multi-user environment.