You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2015/02/12 19:19:38 UTC
svn commit: r1659347 - in /lucene/dev/trunk: lucene/ lucene/core/
lucene/core/src/test/org/apache/lucene/util/
lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/
solr/
Author: uschindler
Date: Thu Feb 12 18:19:38 2015
New Revision: 1659347
URL: http://svn.apache.org/r1659347
Log:
LUCENE-6069: Lucene Core now gets compiled with Java 8 "compact1" profile, all other modules with "compact2".
Modified:
lucene/dev/trunk/lucene/CHANGES.txt
lucene/dev/trunk/lucene/common-build.xml
lucene/dev/trunk/lucene/core/build.xml
lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java
lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java
lucene/dev/trunk/solr/common-build.xml
Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1659347&r1=1659346&r2=1659347&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Thu Feb 12 18:19:38 2015
@@ -10,6 +10,9 @@ System Requirements
* LUCENE-5950: Move to Java 8 as minimum Java version.
(Ryan Ernst, Uwe Schindler)
+* LUCENE-6069: Lucene Core now gets compiled with Java 8 "compact1" profile,
+ all other modules with "compact2". (Robert Muir, Uwe Schindler)
+
New Features
* LUCENE-5735: NumberRangePrefixTreeStrategy now includes interval/range faceting
Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1659347&r1=1659346&r2=1659347&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Thu Feb 12 18:19:38 2015
@@ -165,6 +165,7 @@
<property name="javac.source" value="1.8"/>
<property name="javac.target" value="1.8"/>
<property name="javac.args" value="-Xlint -Xlint:-deprecation -Xlint:-serial -Xlint:-options"/>
+ <property name="javac.profile.args" value="-profile compact2"/>
<property name="javadoc.link" value="http://download.oracle.com/javase/8/docs/api/"/>
<property name="javadoc.link.junit" value="http://junit.sourceforge.net/javadoc/"/>
<property name="javadoc.packagelist.dir" location="${common.dir}/tools/javadoc"/>
@@ -1861,8 +1862,8 @@ ${ant.project.name}.test.dependencies=${
<nested/>
<!-- <compilerarg line="-Xmaxwarns 10000000"/>
<compilerarg line="-Xmaxerrs 10000000"/> -->
- <!-- for generics in Java 1.5: -->
<compilerarg line="${javac.args}"/>
+ <compilerarg line="${javac.profile.args}"/>
<compilerarg line="${javac.doclint.args}"/>
</javac>
</sequential>
Modified: lucene/dev/trunk/lucene/core/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/build.xml?rev=1659347&r1=1659346&r2=1659347&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/build.xml (original)
+++ lucene/dev/trunk/lucene/core/build.xml Thu Feb 12 18:19:38 2015
@@ -35,6 +35,8 @@
org/apache/lucene/index/TestIndexWriterOnJRECrash.class
"/>
+ <!-- lucene core can use the minimal JDK profile -->
+ <property name="javac.profile.args" value="-profile compact1"/>
<import file="../common-build.xml"/>
<property name="moman.commit-hash" value="5c5c2a1e4dea" />
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java?rev=1659347&r1=1659346&r2=1659347&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/StressRamUsageEstimator.java Thu Feb 12 18:19:38 2015
@@ -17,17 +17,7 @@ package org.apache.lucene.util;
* limitations under the License.
*/
-import java.lang.management.GarbageCollectorMXBean;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
-import java.lang.management.MemoryUsage;
-import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-import java.util.Random;
-
-import org.junit.Ignore;
/**
* Estimates how {@link RamUsageEstimator} estimates physical memory consumption
@@ -47,45 +37,19 @@ public class StressRamUsageEstimator ext
}
}
- // This shows an easy stack overflow because we're counting recursively.
- @Ignore
- public void testChainedEstimation() {
- MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
-
- Random rnd = random();
- Entry first = new Entry();
- try {
- while (true) {
- // Check the current memory consumption and provide the estimate.
- long jvmUsed = memoryMXBean.getHeapMemoryUsage().getUsed();
- long estimated = RamUsageTester.sizeOf(first);
- System.out.println(String.format(Locale.ROOT, "%10d, %10d",
- jvmUsed, estimated));
-
- // Make a batch of objects.
- for (int i = 0; i < 5000; i++) {
- first.createNext(new byte[rnd.nextInt(1024)]);
- }
- }
- } catch (OutOfMemoryError e) {
- // Release and quit.
- }
- }
-
volatile Object guard;
// This shows an easy stack overflow because we're counting recursively.
public void testLargeSetOfByteArrays() {
- MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
- causeGc();
- long before = memoryMXBean.getHeapMemoryUsage().getUsed();
+ System.gc();
+ long before = Runtime.getRuntime().totalMemory();
Object [] all = new Object [1000000];
for (int i = 0; i < all.length; i++) {
all[i] = new byte[random().nextInt(3)];
}
- causeGc();
- long after = memoryMXBean.getHeapMemoryUsage().getUsed();
+ System.gc();
+ long after = Runtime.getRuntime().totalMemory();
System.out.println("mx: " + RamUsageEstimator.humanReadableUnits(after - before));
System.out.println("rue: " + RamUsageEstimator.humanReadableUnits(shallowSizeOf(all)));
@@ -112,24 +76,16 @@ public class StressRamUsageEstimator ext
}
public void testSimpleByteArrays() {
- MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
-
Object [][] all = new Object [0][];
try {
while (true) {
// Check the current memory consumption and provide the estimate.
- causeGc();
- MemoryUsage mu = memoryMXBean.getHeapMemoryUsage();
+ System.gc();
long estimated = shallowSizeOf(all);
if (estimated > 50 * RamUsageEstimator.ONE_MB) {
break;
}
- System.out.println(String.format(Locale.ROOT, "%10s\t%10s\t%10s",
- RamUsageEstimator.humanReadableUnits(mu.getUsed()),
- RamUsageEstimator.humanReadableUnits(mu.getMax()),
- RamUsageEstimator.humanReadableUnits(estimated)));
-
// Make another batch of objects.
Object[] seg = new Object[10000];
all = Arrays.copyOf(all, all.length + 1);
@@ -142,24 +98,4 @@ public class StressRamUsageEstimator ext
// Release and quit.
}
}
-
- /**
- * Very hacky, very crude, but (sometimes) works.
- * Don't look, it will burn your eyes out.
- */
- private void causeGc() {
- List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
- List<Long> ccounts = new ArrayList<>();
- for (GarbageCollectorMXBean g : garbageCollectorMXBeans) {
- ccounts.add(g.getCollectionCount());
- }
- List<Long> ccounts2 = new ArrayList<>();
- do {
- System.gc();
- ccounts.clear();
- for (GarbageCollectorMXBean g : garbageCollectorMXBeans) {
- ccounts2.add(g.getCollectionCount());
- }
- } while (ccounts2.equals(ccounts));
- }
}
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java?rev=1659347&r1=1659346&r2=1659347&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/TestSpanQueryParserSimpleSample.java Thu Feb 12 18:19:38 2015
@@ -17,14 +17,13 @@ package org.apache.lucene.queryparser.fl
* limitations under the License.
*/
-import javax.management.Query;
-
import org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler;
import org.apache.lucene.queryparser.flexible.core.nodes.OrQueryNode;
import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode;
import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser;
import org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline;
import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser;
+import org.apache.lucene.search.Query;
import org.apache.lucene.search.spans.SpanQuery;
import org.apache.lucene.search.spans.SpanTermQuery;
import org.apache.lucene.util.LuceneTestCase;
Modified: lucene/dev/trunk/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/common-build.xml?rev=1659347&r1=1659346&r2=1659347&view=diff
==============================================================================
--- lucene/dev/trunk/solr/common-build.xml (original)
+++ lucene/dev/trunk/solr/common-build.xml Thu Feb 12 18:19:38 2015
@@ -29,6 +29,7 @@
<property name="javac.source" value="1.8"/>
<property name="javac.target" value="1.8"/>
<property name="javac.args" value=""/>
+ <property name="javac.profile.args" value=""/>
<property name="dest" location="${common-solr.dir}/build" />
<property name="build.dir" location="${dest}/${ant.project.name}"/>