1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 12:25:35 +02:00

[396783][dstore] fix issues with the spiriting mechanism and other

memory improvements (phase 2)
This commit is contained in:
David McKnight 2012-12-20 13:04:22 -05:00
parent 80d480081d
commit 76c411895e
4 changed files with 20 additions and 4 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2011 IBM Corporation and others. * Copyright (c) 2006, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -23,6 +23,7 @@
* David McKnight (IBM) [320624] [dstore] shell < and > sequence conversion not being applied to thread * David McKnight (IBM) [320624] [dstore] shell < and > sequence conversion not being applied to thread
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support * David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
* Noriaki Takatsu (IBM) - [365765] [dstore][multithread]client environment cause harm to singe-process server * Noriaki Takatsu (IBM) - [365765] [dstore][multithread]client environment cause harm to singe-process server
* David McKnight (IBM) - [396783] [dstore] fix issues with the spiriting mechanism and other memory improvements (phase 2)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.dstore.universal.miners; package org.eclipse.rse.dstore.universal.miners;
@ -32,6 +33,7 @@ package org.eclipse.rse.dstore.universal.miners;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.dstore.core.miners.Miner; import org.eclipse.dstore.core.miners.Miner;
@ -264,13 +266,19 @@ public class CommandMiner extends Miner
Iterator iter = _threads.keySet().iterator(); Iterator iter = _threads.keySet().iterator();
try try
{ {
List threadsToRemove = new ArrayList();
while (iter.hasNext()) while (iter.hasNext())
{ {
String threadName = (String) iter.next(); String threadName = (String) iter.next();
CommandMinerThread theThread = (CommandMinerThread) _threads.get(threadName); CommandMinerThread theThread = (CommandMinerThread) _threads.get(threadName);
if ((theThread == null) || (!theThread.isAlive())) if ((theThread == null) || (!theThread.isAlive()))
{ {
_threads.remove(threadName); threadsToRemove.add(threadName);
}
}
if (!threadsToRemove.isEmpty()){
for (int i = 0; i < threadsToRemove.size(); i++){
_threads.remove(threadsToRemove.get(i));
} }
} }
} }
@ -278,6 +286,8 @@ public class CommandMiner extends Miner
{ {
_dataStore.trace(e); _dataStore.trace(e);
} }
CommandMinerThread newCommand = new CommandMinerThread(subject, invocation, status, getPatterns(), _descriptors); CommandMinerThread newCommand = new CommandMinerThread(subject, invocation, status, getPatterns(), _descriptors);
_threads.put(status.getAttribute(DE.A_ID), newCommand); _threads.put(status.getAttribute(DE.A_ID), newCommand);
newCommand.start(); newCommand.start();

View file

@ -15,6 +15,7 @@
* Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients * Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) - [dstore] cancelable threads not removed fast enough from Hashmap, resulting in OOM * David McKnight (IBM) - [dstore] cancelable threads not removed fast enough from Hashmap, resulting in OOM
* David McKnight (IBM) - [396783] [dstore] fix issues with the spiriting mechanism and other memory improvements (phase 2)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -64,9 +65,10 @@ public class UniversalDownloadHandler extends SecuredThread implements ICancella
{ {
super.run(); super.run();
handleDownload(_cmdElement, _status); handleDownload(_cmdElement, _status);
_isDone = true; _isDone = true;
removeFromCancellableList(); removeFromCancellableList();
_dataStore.disconnectObject(_cmdElement);
} }
private void removeFromCancellableList(){ private void removeFromCancellableList(){

View file

@ -30,6 +30,7 @@
* Noriaki Takatsu (IBM) - [362025] [dstore] Search for text hung in encountering a device definition * Noriaki Takatsu (IBM) - [362025] [dstore] Search for text hung in encountering a device definition
* David McKnight (IBM) - [371401] [dstore][multithread] avoid use of static variables - causes memory leak after disconnect * David McKnight (IBM) - [371401] [dstore][multithread] avoid use of static variables - causes memory leak after disconnect
* Noriaki Takatsu (IBM) - [380562] [multithread][dstore] File Search is not canceled by the client UI on disconnect * Noriaki Takatsu (IBM) - [380562] [multithread][dstore] File Search is not canceled by the client UI on disconnect
* David McKnight (IBM) - [396783] [dstore] fix issues with the spiriting mechanism and other memory improvements (phase 2)
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -166,6 +167,7 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
// completed before setting the status to done // completed before setting the status to done
_status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
_dataStore.refresh(_status); // true indicates refresh immediately _dataStore.refresh(_status); // true indicates refresh immediately
_miner.updateCancellableThreads(_status.getParent(), this);
} }
_alreadySearched.clear(); _alreadySearched.clear();
@ -377,6 +379,7 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
checkAndClearupMemory(); checkAndClearupMemory();
File child = children[i]; File child = children[i];
internalSearch(child, depth - 1); internalSearch(child, depth - 1);
} }
} }
} }

View file

@ -67,6 +67,7 @@
* David McKnight (IBM) - [365780] [dstore] codepage conversion should only occur for different encodings * David McKnight (IBM) - [365780] [dstore] codepage conversion should only occur for different encodings
* David McKnight (IBM) - [390037] [dstore] Duplicated items in the System view * David McKnight (IBM) - [390037] [dstore] Duplicated items in the System view
* David McKnight (IBM) - [391164] [dstore] don't clear cached elements when they're not spirited or deleted * David McKnight (IBM) - [391164] [dstore] don't clear cached elements when they're not spirited or deleted
* David McKnight (IBM) - [396783] [dstore] fix issues with the spiriting mechanism and other memory improvements (phase 2)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.services.dstore.files; package org.eclipse.rse.internal.services.dstore.files;
@ -304,7 +305,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (ds != null) if (ds != null)
{ {
String[] clonedAttributes = (String[])_filterAttributes.clone(); String[] clonedAttributes = (String[])_filterAttributes.clone();
clonedAttributes[DE.A_ID] = fileNameFilter; //clonedAttributes[DE.A_ID] = fileNameFilter;
DataElement attributes = ds.createTransientObject(clonedAttributes); DataElement attributes = ds.createTransientObject(clonedAttributes);
String version = IServiceConstants.VERSION_1; String version = IServiceConstants.VERSION_1;