mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-29 03:03:10 +02:00
[261644] [dstore] remote search improvements
-updating with changes that had gone into 3.0.3
This commit is contained in:
parent
26c3107d80
commit
8be739b9a0
1 changed files with 29 additions and 41 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2006, 2009 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -30,10 +30,7 @@ import java.io.BufferedReader;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.dstore.core.model.DE;
|
||||
import org.eclipse.dstore.core.model.DataElement;
|
||||
|
@ -363,11 +360,6 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
|
|||
long MAX_FILE = Runtime.getRuntime().freeMemory() / 4;
|
||||
long fileLength = theFile.length();
|
||||
|
||||
//System.out.println("file="+absPath);
|
||||
//System.out.println("MAX mem="+MAX_FILE);
|
||||
//System.out.println("fileLength="+fileLength);
|
||||
//if (fileLength < MAX_FILE)
|
||||
if (true){ // if the file is too big, the server will run out of memory
|
||||
inputStream = new FileInputStream(theFile);
|
||||
InputStreamReader reader = new InputStreamReader(inputStream);
|
||||
BufferedReader bufReader = new BufferedReader(reader);
|
||||
|
@ -400,11 +392,7 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
|
|||
}
|
||||
return foundMatches;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_dataStore.trace("skipped:"+absPath + " due to memory constraints"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
catch (OutOfMemoryError e){
|
||||
if (SystemServiceManager.getInstance().getSystemService() == null)
|
||||
|
|
Loading…
Add table
Reference in a new issue