-
Notifications
You must be signed in to change notification settings - Fork 11
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
measure doesn't work under openjdk 17, despite -J-Djdk.attach.allowAttachSelf #10
Comments
Hi, Peter. Indeed, the implementation of clj-memory-meter on JDK17+ uses Unsafe, and that approach is quite brittle and will continue to show more and more shortcomings in the future. Unfortunately, we can't do much with that up until JDK-8249196 ships someday. For now, I have pushed |
Thank you for the fast response @alexander-yakushev! I wondered if this was a JAMM / JVM issue but thought I'd track it here anyway, just in case. |
As an FYI, I just hit this as well with Oracle JDK-17. Different error but likely same basic problem. |
Is it an actual exception thrown or just the warnings being printed while some result is still returned? Are you using |
it is an actual exception - basically a NPE. I will post the actual result when I get a chance tomorrow. Yes, it is 0.2.3 and it actually occurs during the require of the core namespace. |
(deps '[[com.clojure-goes-fast/clj-memory-meter "0.2.3"]])
=> :success
(require '[clj-memory-meter.core :as mm])
=> "ERROR : Compiler$CompilerException, Cannot open <nil> as an InputStream." |
Could you please tell which OS you try it on and the output of What does the function |
OS: ubuntu 22.04 java: In this use case, I am using aerosaite and I don't return full stack traces. Hmmm, OTOH, I could connect via repl port and try via cider to get a full trace. deps is a dynamic dependency loader. It's been used against all manner libs many with very complex dependencies - if it succeeds it has always provided the correct dependencies. I suppose memory-meter could be the exception, but seems very unlikely. Re: pst and 'repl'. Hang on - does this thing require a "standard" clojure repl? If so, that is probably the problem here - Saite does not use that. I will plug in to the server via repl port to see if works from standard repl. |
The full stacktrace would really help if you can somehow extract that. Also, meanwhile, could you please do the following:
|
Can you please confirm that you have a complete JDK installed and not just JRE? |
since the core require blows up immediately, none of its resources appear to be loaded - actually I don't even see the namespace. Yes, it is full JDK I think this is probably due to not using typical repl middleware, but will verify by trying it via typical cider repl |
Please, do try with the regular REPL. However, clj-memory-meter does not rely on anything REPL-related being present (I think). I guess, getting the stacktrace is the only way to decipher this. |
Possibly also related to Java 8 Lambda classes?
Steps to reproduce:
Full Stack Trace:
Environment:
macOS Ventura (13.0.1)
2019 Intel MacBookPro
The text was updated successfully, but these errors were encountered: