import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DALimit;
import org.tizen.dynamicanalyzer.database.IResultSet;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
}
public void makeData() {
- HashMap<Integer, CurrentLeakData> leaks = leakDetector.getLeakHash();
+ Map<Integer, CurrentLeakData> leaks = leakDetector.getLeakHash();
for (Integer key : leaks.keySet()) {
makeLeakData(leaks.get(key));
}
package org.tizen.dynamicanalyzer.ui.summary.leaks;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
@Override
public List<TreeInput> makeTreeInput() {
List<TreeInput> output = new ArrayList<TreeInput>();
- HashMap<Integer, CurrentLeakData> leaks = null;
+ Map<Integer, CurrentLeakData> leaks = null;
List<List<Object>> leakDataList = null;
// TODO : make hashkey (LogData.getKey() --> combination of pid and
// address)
package org.tizen.dynamicanalyzer.ui.summary.leaks;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.data.SettingConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.data.SettingDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.data.TargetData;
-import org.tizen.dynamicanalyzer.util.Logger;
public class NewLeakDetector {
// TODO : understand and refactoring
// HashMap<Long, CurrentLeakData> leakHash;
// HashMap<Long, CurrentLeakData> childHash;
- HashMap<Integer, CurrentLeakData> leakHash;
+ Map<Integer, CurrentLeakData> leakHash;
private int leakSeq = 0;
public NewLeakDetector() {
return leakList;
}
- public HashMap<Integer, CurrentLeakData> getLeakHash() {
+ public Map<Integer, CurrentLeakData> getLeakHash() {
if (null == leakHash) {
- leakHash = new HashMap<Integer, CurrentLeakData>();
+ leakHash = new ConcurrentHashMap<Integer, CurrentLeakData>();
}
return leakHash;
}
if (isDropLog(logData)) return result;
- HashMap<Integer, CurrentLeakData> leaks = getLeakHash();
+ Map<Integer, CurrentLeakData> leaks = getLeakHash();
if (logData instanceof MemoryData) {
MemoryData mlog = (MemoryData) logData;
if (mlog.getMemoryApiType() == LogCenterConstants.MEMORY_API_ALLOC) {
return result;
}
- private void addCurrentLeakData(HashMap<Integer, CurrentLeakData> leaks, LogData log) {
+ private void addCurrentLeakData(Map<Integer, CurrentLeakData> leaks, LogData log) {
CurrentLeakData newLeak = new CurrentLeakData(log);
- leaks.put((Integer)log.getKey(), newLeak);
+ ((ConcurrentHashMap<Integer, CurrentLeakData>)leaks).put((Integer)log.getKey(), newLeak);
leakSeq++;
}
leakSeq++;
}
- private int findAllocatedKey(HashMap<Integer, CurrentLeakData> leaks, long addr, int pid) {
+ private int findAllocatedKey(Map<Integer, CurrentLeakData> leaks, long addr, int pid) {
for (Integer key : leaks.keySet()) {
CurrentLeakData iLeakData = leaks.get(key);
if (iLeakData.getAllocatedValue() == addr && iLeakData.getPid() == pid) {