Comments (6)
I am facing the same issue, using javamelody-spring-boot-starter 2.0.0.
Please change the implementation of MBeansAccessor.getThreadAllocatedBytes to the following. I opened a PR.
static long getThreadAllocatedBytes(long threadId) {
if (!isMbeanAllocatedBytesEnabled()) { // CHANGE THIS
return -1L;
}
try {
return (Long) MBEAN_SERVER.invoke(THREADING, "getThreadAllocatedBytes",
new Object[] { threadId }, THREAD_ALLOCATED_BYTES_SIGNATURE);
} catch (final JMException e) {
throw new IllegalStateException(e);
}
}
// ADD THIS
private boolean isMbeanAllocatedBytesEnabled() {
try {
Attribute supported = (Attribute) MBEAN_SERVER.getAttribute(THREADING, "ThreadAllocatedMemorySupported");
Attribute enabled = (Attribute) MBEAN_SERVER.getAttribute(THREADING, "ThreadAllocatedMemoryEnabled");
return ((boolean) supported.getValue()) && ((boolean) enabled.getValue());
} catch (Exception ex) {
// ignored
}
return false;
}
from javamelody.
Same issue with newer versions of IBM Java 11:
java version "11.0.19" 2023-04-18
IBM Semeru Runtime Certified Edition for z/OS 11.0.19.0 (build 11.0.19+7)
IBM J9 VM 11.0.19.0 (build z/OS-Release-11.0.19.0-b01, JRE 11 z/OS s390x-64-Bit Compressed References 20230516_269 (JIT enabled, AOT enabled)
OpenJ9 - a92690a70a9
OMR - 9f28c98e431
IBM - 68444b7
JCL - 05b3cf78a01 based on jdk-11.0.19+7)
I would be very grateful for a new release of JavaMeldoy with the fix...
from javamelody.
PR reviewed
from javamelody.
from javamelody.
Thank you, code adjusted according to review.
from javamelody.
Looks good, thank you!
from javamelody.
Related Issues (20)
- java.lang.NoClassDefFoundError: org/jrobin/core/RrdException HOT 2
- Is it possible to run it on a Minecraft 1.18.2 Fabric server with OpenJ9 JVM? HOT 1
- Auto registrating in optional collector in spring-boot-starter HOT 2
- InfluxDB 2.X (Auth) Support HOT 3
- Unable to expand to get more details
- Persist statistics data to database HOT 1
- Javamelody 2.0.1/Jakarta EE 10/Java 17 HOT 8
- MBeans view on JBoss/WildFly leads to OutOfMemoryError HOT 2
- Exception NoClassDefFoundError (HttpSessionListener) when trying to start Tomcat HOT 2
- License called "ASL" HOT 4
- Unable to Delete Cache Entries after Upgrading to Spring Boot 3.2.1 with EhCache 3.10.8 and JavaMelody 2.0.1 with JCaheManager
- Question about sending alerts HOT 3
- Kubernetes. Is there a way to save the data to a fixed storage directory? HOT 2
- Collect Server War uses highly vulnerable version of Jackson Databind HOT 5
- Error 500 from Confluence DC 8.7.2 HOT 2
- JavaMelodyDisabledAutoConfiguration turns off MonitoringFilter in every webapp (if many are deployed) HOT 1
- Release new OfflineViewer
- PostgreSQL pg_database request fails due to missing column since PostgreSQL 15
- NPE in jira-confluence-javamelody-1.98.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javamelody.