Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 286359 Details for
Bug 570670
Optimisations for GarbageCleaner
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
8_enqueue_only_pointers.patch
8_enqueue_only_pointers.patch (text/plain), 4.76 KB, created by
Jason Koch
on 2021-05-11 09:01:29 EDT
(
hide
)
Description:
8_enqueue_only_pointers.patch
Filename:
MIME Type:
Creator:
Jason Koch
Created:
2021-05-11 09:01:29 EDT
Size:
4.76 KB
patch
obsolete
>diff --git a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/internal/snapshot/ObjectMarker.java b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/internal/snapshot/ObjectMarker.java >index 035be809..b014391d 100644 >--- a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/internal/snapshot/ObjectMarker.java >+++ b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/internal/snapshot/ObjectMarker.java >@@ -3,8 +3,8 @@ > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License 2.0 > * which accompanies this distribution, and is available at >- * https://www.eclipse.org/legal/epl-2.0/ >- * >+ * https://www.eclipse.org/legal/epl-2.0/ >+ * > * SPDX-License-Identifier: EPL-2.0 > * > * Contributors: >@@ -63,59 +63,52 @@ public class ObjectMarker > > public class FjObjectMarker extends RecursiveAction > { >- final int[] roots; >+ final int position; > final boolean[] visited; >- final IIndexReader.IOne2ManyIndex outbound; > final boolean topLevel; > >- private FjObjectMarker(final int[] roots, final boolean[] visited, final IIndexReader.IOne2ManyIndex outbound, >- final boolean topLevel) >+ int counter = 0; >+ >+ private FjObjectMarker(final int position, final boolean[] visited, final boolean topLevel) > { >- this.roots = roots; >+ // for the very root >+ visited[position] = true; >+ this.position = position; > this.visited = visited; >- this.outbound = outbound; > this.topLevel = topLevel; > } > > public void compute() > { >+ if (progressListener.isCanceled()) >+ { return; } >+ >+ compute(position, LEVELS_RUN_INLINE); >+ > if (topLevel) > { >- // report progress only for top level tasks >- progressListener.beginTask(Messages.ObjectMarker_MarkingObjects, roots.length); >- compute(roots, LEVELS_RUN_INLINE); >- progressListener.done(); >- } else { >- compute(roots, LEVELS_RUN_INLINE); >+ progressListener.worked(1); > } > } > >- void compute(final int[] currentRoots, final int levelsLeft) >+ public void compute(int outboundPosition, int levelsLeft) > { >- for (int r : currentRoots) >+ final int[] process = outbound.get(outboundPosition); >+ >+ for (int r : process) > { >- // mark away > if (!visited[r]) > { > visited[r] = true; >- int[] nextLevel = outbound.get(r); > if (levelsLeft == 0) > { >- new FjObjectMarker(nextLevel, visited, outbound, false).fork(); >+ new FjObjectMarker(r, visited, false).fork(); > } > else > { >- compute(nextLevel, levelsLeft - 1); >+ compute(r, levelsLeft - 1); > } > } >- >- // update UI, check for stop >- if (topLevel) >- { >- progressListener.worked(1); >- if (progressListener.isCanceled()) >- { return; } >- } > } > } > } >@@ -137,17 +130,24 @@ public class ObjectMarker > > public void markMultiThreaded(int threads) throws InterruptedException > { >- // to control number of threads, and cleanly wait for comlpetion, create our own pool >- // in theory this should automatically determined by FJ commonPool, however that >+ progressListener.beginTask(Messages.ObjectMarker_MarkingObjects, roots.length); >+ > // would break the interface specifying 'threads' > ForkJoinPool pool = new ForkJoinPool(threads); >- pool.execute(new FjObjectMarker(roots, bits, outbound, true)); >+ for (int r : roots) { >+ // new FjObjectMarker(r, bits, true).invoke(); >+ pool.execute(new FjObjectMarker(r, bits, true)); >+ } > pool.shutdown(); >- while (!pool.awaitTermination(1000, TimeUnit.MILLISECONDS)) >+ >+ while (!pool.awaitTermination(60, TimeUnit.SECONDS)) > { >+ System.out.println("waiting for ObjectMarker threads"); > // being stuck here would be a bug; tasks are not ending > // TODO is there a heuristic that can be used to flag if no progress is made? > } >+ >+ progressListener.done(); > } > > int countMarked()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 570670
:
285390
|
285391
|
285392
|
285393
|
285394
|
285395
|
286012
|
286013
|
286014
|
286359
|
286512