-
Couldn't load subscription status.
- Fork 6.1k
8359706: Add file descriptor count and maximum limit to VM.info #27971
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
base: master
Are you sure you want to change the base?
Changes from all commits
8b78feb
d48a20f
1794ca1
a4e451f
204c783
af4c66c
a0185ac
ccecd6c
be54098
a72e97b
701f20e
1ea8863
67b9131
0663271
0d8d72d
14dca9c
d796913
2d2acfe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5449,3 +5449,20 @@ bool os::pd_dll_unload(void* libhandle, char* ebuf, int ebuflen) { | |
|
|
||
| return res; | ||
| } // end: os::pd_dll_unload() | ||
|
|
||
| void os::print_open_file_descriptors(outputStream* st) { | ||
| DIR* dirp = opendir("/proc/self/fd"); | ||
| int fds = 0; | ||
| if (dirp != nullptr) { | ||
| struct dirent* dentp; | ||
| while ((dentp = readdir(dirp)) != nullptr) { | ||
| if (isdigit(dentp->d_name[0])) { | ||
| fds++; | ||
| } | ||
| } | ||
| closedir(dirp); | ||
| st->print_cr("OpenFileDescriptorCount = %d", fds - 1); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a comment on why we do |
||
| } else { | ||
| st->print_cr("OpenFileDescriptorCount = unknown"); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1432,6 +1432,12 @@ void VMError::print_vm_info(outputStream* st) { | |
| st->cr(); | ||
| } | ||
|
|
||
| // STEP("printing number of open file descriptors") | ||
| #ifndef _WIN32 | ||
| os::print_open_file_descriptors(st); | ||
| st->cr(); | ||
| #endif | ||
|
|
||
|
Comment on lines
+1435
to
+1440
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in |
||
| // Take heap lock over heap, GC and metaspace printing so that information | ||
| // is consistent. | ||
| if (Universe::is_fully_initialized()) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
defined(_ALLBSD_SOURCE)needed? The return type for the non-apple variant is incorrect. Maybe we could do something like the following here instead: