// common
public static final int MAX_TRACE_TIME_INSECOND = 24*60*60; // 1 day
public static final long MAX_SEQUENCE_NUMBER = Long.MAX_VALUE; //2^63-1, 4G*2G-1
- public static final int MAX_PROCESS_COUNT = 2^16; // 65535
- public static final int MAX_BINARY_COUNT = 2^16; // 65535
- public static final int MAX_FUNCTION_COUNT = 2^20; // 1,048,576
+ public static final int MAX_PROCESS_COUNT = (int) Math.pow(2, 16); // 65535
+ public static final int MAX_BINARY_COUNT = (int) Math.pow(2, 16); // 65535
+ public static final int MAX_FUNCTION_COUNT = (int) Math.pow(2, 20); // 1,048,576
public static final int MAX_FUNCTION_ARGUMENTS_COUNT = FUNCTION_ARGUMENTS_FORMAT_LENGTH; // Because "MAX_FUNCTION_ARGUMENTS_COUNT < FUNCTION_ARGUMENTS_FORMAT_LENGTH" is always true
// Leak
- public static final int MAX_LEAK_CHECK_BUFFER_SIZE = 2^20; // 1,048,576
+ public static final int MAX_LEAK_CHECK_BUFFER_SIZE = (int) Math.pow(2, 20); // 1,048,576
// File Analysis
- public static final int MAX_FILE_COUNT = 2^10; // 1024
- public static final int MAX_FILE_STATUS_COUNT = 2^10*100; // 102400
- public static final int MAX_FILE_ACCESSOR_COUNT = 2^10*100; // 102400
+ public static final int MAX_FILE_COUNT = (int) Math.pow(2, 10); // 1024
+ public static final int MAX_FILE_STATUS_COUNT = ((int) Math.pow(2, 10))*100; // 102400
+ public static final int MAX_FILE_ACCESSOR_COUNT = ((int) Math.pow(2, 10))*100; // 102400
}
for (int i = 0; i < size; i++) {
LogData input = (LogData) inputs.get(i);
if (input == null) continue;
- checkHeapMemory();
+ if (isHeapMemoryOverflow())
+ break;
switch (leakDetector.runLeakDetect(input)) {
case LogCenterConstants.MEMORY_API_ALLOC: // alloc, realloc
makeAllocData(input);
}
}
- private void checkHeapMemory() {
+ private boolean isHeapMemoryOverflow() {
+ boolean flag = false;
if (leakDetector.getLeakHash().size() > DALimit.MAX_LEAK_CHECK_BUFFER_SIZE) {
ToolbarArea.getInstance().stopTrace();
Display.getDefault().asyncExec(new Runnable() {
dialog.open();
}
});
- }
+
+ flag = true;
+ }
+
+ return flag;
}
public void makeAllocData(LogData log) {