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

feat(server): support in-heap memory JVM monitor #2650

Merged
merged 8 commits into from
Oct 15, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
modify LOG type
  • Loading branch information
MingzhenHan authored Oct 9, 2024
commit 310c8d7e1a81acc64f4ecbdaab75b7b86821b440
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ private void runMemoryDetect() {
double memoryUsagePercentage = getMemoryUsagePercentage();

if (memoryUsagePercentage > MEMORY_MONITOR_THRESHOLD) {
LOG.info("JVM memory usage is '{}', exceeding the threshold of '{}'.",
LOG.warn("JVM memory usage is '{}', exceeding the threshold of '{}'.",
memoryUsagePercentage, MEMORY_MONITOR_THRESHOLD);
System.gc();
LOG.info("Trigger System.gc()");
LOG.warn("Trigger System.gc()");

double doubleCheckUsage = getMemoryUsagePercentage();
if (doubleCheckUsage > MEMORY_MONITOR_THRESHOLD) {
LOG.info("JVM memory usage is '{}', exceeding the threshold of '{}'.",
LOG.warn("JVM memory usage is '{}', exceeding the threshold of '{}'.",
doubleCheckUsage, MEMORY_MONITOR_THRESHOLD);
interruptHighestMemoryThread();
}
Expand Down Expand Up @@ -99,7 +99,7 @@ private void interruptHighestMemoryThread() {
Thread targetThread = getHighestMemoryThread();
if (targetThread != null) {
targetThread.interrupt();
LOG.info("Send interrupt to '{}' thread",
LOG.warn("Send interrupt to '{}' thread",
targetThread.getName());
}
}
Expand Down
Loading