From: <tho...@us...> - 2013-08-28 20:01:53
|
Revision: 7357 http://bigdata.svn.sourceforge.net/bigdata/?rev=7357&view=rev Author: thompsonbry Date: 2013-08-28 20:01:46 +0000 (Wed, 28 Aug 2013) Log Message: ----------- Modified StaticFrontier2 to clear out any non-null elements in the backing array. This addresses a GC leak during the computation. Modified TLScheduler to clear the map of per-thread schedulers rather than clearing each per-thread scheduler. This is a big hot spot. See #629 Modified Paths: -------------- branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/StaticFrontier2.java branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/scheduler/TLScheduler.java Modified: branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/StaticFrontier2.java =================================================================== --- branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/StaticFrontier2.java 2013-08-28 19:47:36 UTC (rev 7356) +++ branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/StaticFrontier2.java 2013-08-28 20:01:46 UTC (rev 7357) @@ -119,6 +119,18 @@ } /* + * Null fill until the end of the last frontier. That will help out GC. + * Otherwise those IV references are pinned and can hang around. We + * could track the high water mark on the backing array for this + * purpose. + */ + for (int i = nvertices; i < a.length; i++) { + if (a[i] == null) + break; + a[i] = null; + } + + /* * Take a slice of the backing showing only the valid entries and use it * to replace the view of the backing array. */ Modified: branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/scheduler/TLScheduler.java =================================================================== --- branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/scheduler/TLScheduler.java 2013-08-28 19:47:36 UTC (rev 7356) +++ branches/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/scheduler/TLScheduler.java 2013-08-28 20:01:46 UTC (rev 7357) @@ -122,13 +122,16 @@ /* * Clear the per-thread maps, but do not discard. They will be reused in * the next round. + * + * FIXME This is a big cost. Try simply clearing [map] and see if that + * is less expensive. */ - for (STScheduler s : map.values()) { - - s.clear(); - - } - +// for (STScheduler s : map.values()) { +// +// s.clear(); +// +// } + map.clear(); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |