[
https://issues.apache.org/jira/browse/LUCENE-6239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14316743#comment-14316743
]
Uwe Schindler edited comment on LUCENE-6239 at 2/11/15 6:46 PM:
----------------------------------------------------------------
Hi,
I just found out: With Java 1.7+, all the Unsafe constants are exposed as
public static final variables. So we dont need to directly access the unsafe
constant.
By that it would be possible to get the REFERENCE_SIZE without hotspot bean
just by getting a static final int constant... The same applies fo the JVM
bitness.
Would this be a valid use? In fact there can break nothing, it could just be
that our code cannot see those constants, but thats not different from the
HotspotBean. We are just reading a public static constant from Unsafe (via
reflection).
We just did not use that in RAMUsageEstimator before, because in Java 6, those
constants were not there! On the other hand, in Java 9, Unsafe is likely to
disappear, so I think we should really work without Unsafe.
was (Author: thetaphi):
Hi,
I just found out: With Java 1.7+, all the Unsafe constants are exposed as
public static final variables. So we dont need to directly access the unsafe
constant.
By that it would be possible to get the REFERENCE_SIZE without hotspot bean
just be getting a static final int constant... The same applies fo the JVM
bitness.
Would this be a valid use? In fact there can break nothing, it could just be
that our code cabnot see those constants, but thats not different from the
HotspotBean.
We just did not use that in RAMUsageEstimator before, because in Java 6, those
constants were not there! On the other hand, in Java 9, Unsafe is likely to
disappear, so I think we should really work without Unsafe.
> Remove RAMUsageEstimator Unsafe calls
> -------------------------------------
>
> Key: LUCENE-6239
> URL: https://issues.apache.org/jira/browse/LUCENE-6239
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Attachments: LUCENE-6239.patch
>
>
> This is unnecessary risk. We should remove this stuff, it is not needed here.
> We are a search engine, not a ram calculator.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]