Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce load in MultiCL SharedClasses test #99

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private enum Modes {
SCM20("-Xshareclasses:name=${cacheName},cacheDir=${cacheDir}${cacheOperation} -Xitn5000 -Xitsn0"), // default value for itn was 2000 at Nov 2010
SCM21("-Xshareclasses:name=${cacheName},cacheDir=${cacheDir}${cacheOperation},nojitdata"),
SCM22("-Xshareclasses:name=${cacheName},cacheDir=${cacheDir}${cacheOperation} -Xscdmx18m"),
SCM23("-Xshareclasses:name=${cacheName},cacheDir=${cacheDir}${cacheOperation} -Xaot:forceAoT,count=1"),
SCM23("-Xshareclasses:name=${cacheName},cacheDir=${cacheDir}${cacheOperation} -Xaot:forceAoT,count=1"),
SCM24("-Xshareclasses:name=${cacheName},cacheDir=${cacheDir}${cacheOperation},mprotect=onfind"), // Was used to test that the last partially filled pages in the shared cache are kept write protected
noSC("");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 IBM Corp.
* Copyright (c) 2016, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which accompanies this distribution
Expand Down Expand Up @@ -69,10 +69,18 @@ public void run(String jarName)
File jarFile = new File(file.getName());
URL myURL = new URL("file", null, 0, jarFile.getCanonicalPath().replace('\\', '/'));
URL[] myURLS = {myURL};
long startTime = System.currentTimeMillis();
boolean loadDone = false;

for(Enumeration<JarEntry> entries = file.entries(); entries.hasMoreElements();)
{
if (loadDone) {
break;
}

JarEntry entry = entries.nextElement();
String className = entry.getName();

if(className.endsWith(".class"))
{
URLClassLoader myCL = new URLClassLoader(myURLS);
Expand All @@ -91,8 +99,18 @@ public void run(String jarName)
{
cntr++;
Dummy myDummy = (Dummy)myC.newInstance();
if(cntr % 1000 == 0)
if(cntr % 1000 == 0) {
logMessage("Loaded " + cntr + " classes...");

// This flag has been added to terminate the load test within 10 minutes
// keeping in mind that the test launches 5 processes to simultaneously run this load and
// the overall time it takes is especially slow on certain platforms (e.g. Windows).
long durationInMinutes = (System.currentTimeMillis() - startTime) / (1000 * 60);
if (durationInMinutes > 10) {
loadDone = true;
logMessage("Test duration expired - Ran a 10m load");
}
}
id = myDummy.getID();
name = myDummy.getName();
}
Expand Down