mirror of https://github.com/apache/lucene.git
better memory estimate
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@475844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a116a8b99
commit
34e917af03
|
@ -478,11 +478,15 @@ public class MemoryIndex {
|
|||
}
|
||||
|
||||
private static boolean is64BitVM() {
|
||||
int bits = Integer.getInteger("sun.arch.data.model", 0).intValue();
|
||||
if (bits != 0) return bits == 64;
|
||||
|
||||
// fallback if sun.arch.data.model isn't available
|
||||
return System.getProperty("java.vm.name").toLowerCase().indexOf("64") >= 0;
|
||||
try {
|
||||
int bits = Integer.getInteger("sun.arch.data.model", 0).intValue();
|
||||
if (bits != 0) return bits == 64;
|
||||
|
||||
// fallback if sun.arch.data.model isn't available
|
||||
return System.getProperty("java.vm.name").toLowerCase().indexOf("64") >= 0;
|
||||
} catch (Throwable t) {
|
||||
return false; // better safe than sorry (applets, security managers, etc.) ...
|
||||
}
|
||||
}
|
||||
|
||||
private int numPositions(ArrayIntList positions) {
|
||||
|
|
Loading…
Reference in New Issue