[JBoss JIRA] (ISPN-6085) Avoid using sun.misc.VM
by Sanne Grinovero (JIRA)
[ https://issues.jboss.org/browse/ISPN-6085?page=com.atlassian.jira.plugin.... ]
Sanne Grinovero commented on ISPN-6085:
---------------------------------------
+1 for [~dan.berindei]'s idea of accepting these are just estimated.
But if we accept that, we should also accept that it might have been set to size zero (disabled the cache). I think it's safer to over-estimate than underestimate memory utilization, so what about simplifying this code and ignore the autobox cache?
> Avoid using sun.misc.VM
> -----------------------
>
> Key: ISPN-6085
> URL: https://issues.jboss.org/browse/ISPN-6085
> Project: Infinispan
> Issue Type: Task
> Components: Core
> Affects Versions: 8.1.0.Final
> Reporter: Sanne Grinovero
> Assignee: William Burns
>
> The function {{org.infinispan.container.entries.PrimitiveEntrySizeCalculator.IntegerCacheConstraints.calculateMaxIntCache()}} is using {{sun.misc.VM}}.
> This class is being moved and "idden" in Java 9:
> - http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/037853....
> Could we try avoiding the need for this, or explore alternatives?
> One could use reflection to see if the class is available without loading it explicitly, but that still needs some sensible fallback for the case in which the class isn't available.
> Even if this looks like a small detail, this completely blocks the possibility to test Infinispan on Java 9.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (ISPN-6085) Avoid using sun.misc.VM
by Sanne Grinovero (JIRA)
[ https://issues.jboss.org/browse/ISPN-6085?page=com.atlassian.jira.plugin.... ]
Sanne Grinovero edited comment on ISPN-6085 at 1/20/16 11:36 AM:
-----------------------------------------------------------------
+1 for [~dan.berindei]'s idea of accepting these are just estimates.
But if we accept that, we should also accept that it might have been set to size zero (disabled the cache). I think it's safer to over-estimate than underestimate memory utilization, so what about simplifying this code and ignore the autobox cache?
was (Author: sannegrinovero):
+1 for [~dan.berindei]'s idea of accepting these are just estimated.
But if we accept that, we should also accept that it might have been set to size zero (disabled the cache). I think it's safer to over-estimate than underestimate memory utilization, so what about simplifying this code and ignore the autobox cache?
> Avoid using sun.misc.VM
> -----------------------
>
> Key: ISPN-6085
> URL: https://issues.jboss.org/browse/ISPN-6085
> Project: Infinispan
> Issue Type: Task
> Components: Core
> Affects Versions: 8.1.0.Final
> Reporter: Sanne Grinovero
> Assignee: William Burns
>
> The function {{org.infinispan.container.entries.PrimitiveEntrySizeCalculator.IntegerCacheConstraints.calculateMaxIntCache()}} is using {{sun.misc.VM}}.
> This class is being moved and "idden" in Java 9:
> - http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/037853....
> Could we try avoiding the need for this, or explore alternatives?
> One could use reflection to see if the class is available without loading it explicitly, but that still needs some sensible fallback for the case in which the class isn't available.
> Even if this looks like a small detail, this completely blocks the possibility to test Infinispan on Java 9.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (ISPN-6085) Avoid using sun.misc.VM
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-6085?page=com.atlassian.jira.plugin.... ]
Dan Berindei commented on ISPN-6085:
------------------------------------
I think the {{java.lang.Integer.IntegerCache.high}} property is only used internally by {{-XX:AutoBoxCacheMax=<size>}} and is removed during boot by {{VM.saveAndRemoveProperties()}}, so it's not available via {{System.getProperty()}}.
We could use reflection to read the value from the {{Integer.IntegerCache}} class, or we could assume it's 127 and accept that our size estimate is going to be too high when {{-XX:AutoBoxCacheMax=<size>}} is used.
> Avoid using sun.misc.VM
> -----------------------
>
> Key: ISPN-6085
> URL: https://issues.jboss.org/browse/ISPN-6085
> Project: Infinispan
> Issue Type: Task
> Components: Core
> Affects Versions: 8.1.0.Final
> Reporter: Sanne Grinovero
> Assignee: William Burns
>
> The function {{org.infinispan.container.entries.PrimitiveEntrySizeCalculator.IntegerCacheConstraints.calculateMaxIntCache()}} is using {{sun.misc.VM}}.
> This class is being moved and "idden" in Java 9:
> - http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/037853....
> Could we try avoiding the need for this, or explore alternatives?
> One could use reflection to see if the class is available without loading it explicitly, but that still needs some sensible fallback for the case in which the class isn't available.
> Even if this looks like a small detail, this completely blocks the possibility to test Infinispan on Java 9.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (ISPN-6085) Avoid using sun.misc.VM
by Sanne Grinovero (JIRA)
Sanne Grinovero created ISPN-6085:
-------------------------------------
Summary: Avoid using sun.misc.VM
Key: ISPN-6085
URL: https://issues.jboss.org/browse/ISPN-6085
Project: Infinispan
Issue Type: Task
Components: Core
Affects Versions: 8.1.0.Final
Reporter: Sanne Grinovero
Assignee: William Burns
The function {{org.infinispan.container.entries.PrimitiveEntrySizeCalculator.IntegerCacheConstraints.calculateMaxIntCache()}} is using {{sun.misc.VM}}.
This class is being moved and "idden" in Java 9:
- http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/037853....
Could we try avoiding the need for this, or explore alternatives?
One could use reflection to see if the class is available without loading it explicitly, but that still needs some sensible fallback for the case in which the class isn't available.
Even if this looks like a small detail, this completely blocks the possibility to test Infinispan on Java 9.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months