1 Star 0 Fork 81

Benshuai5D/openjdk-1.8.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
0005-8196743-jstatd-doesn-t-see-new-Java-processes-inside.patch 2.30 KB
一键复制 编辑 原始数据 按行查看 历史
Date: Wed, 31 May 2023 09:22:26 +0000
Subject: [PATCH 05/59] 8196743: jstatd doesn't see new Java processes inside Docker container
Bug url: https://bugs.openjdk.org/browse/JDK-8196743
---
.../perfdata/monitor/protocol/local/LocalVmManager.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java
index 35d25700d..4be281f65 100644
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,6 @@ import java.io.*;
*/
public class LocalVmManager {
private String userName; // user name for monitored jvm
- private List<String> tmpdirs;
private Pattern userPattern;
private Matcher userMatcher;
private FilenameFilter userFilter;
@@ -77,9 +76,7 @@ public class LocalVmManager {
public LocalVmManager(String user) {
this.userName = user;
-
if (userName == null) {
- tmpdirs = PerfDataFile.getTempDirectories(null, 0);
userPattern = Pattern.compile(PerfDataFile.userDirNamePattern);
userMatcher = userPattern.matcher("");
@@ -89,8 +86,6 @@ public class LocalVmManager {
return userMatcher.lookingAt();
}
};
- } else {
- tmpdirs = PerfDataFile.getTempDirectories(userName, 0);
}
filePattern = Pattern.compile(PerfDataFile.fileNamePattern);
@@ -134,6 +129,7 @@ public class LocalVmManager {
* we'd see strange file names being matched by the matcher.
*/
Set<Integer> jvmSet = new HashSet<Integer>();
+ List<String> tmpdirs = PerfDataFile.getTempDirectories(userName, 0);
for (String dir : tmpdirs) {
File tmpdir = new File(dir);
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangyunbo7/openjdk-1.8.0.git
git@gitee.com:zhangyunbo7/openjdk-1.8.0.git
zhangyunbo7
openjdk-1.8.0
openjdk-1.8.0
master

搜索帮助