-
Notifications
You must be signed in to change notification settings - Fork 112
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
100% CPU when the _SC_OPEN_MAX is a big number #147
Comments
The issue should also be fixed by PR #124 |
For Linux users affected by this problem and looking for a workaround until #149 is released: |
Thank you for reporting and sorry for the delay. Should be fixed by 04685d8 and available since pty4j version 0.12.27. |
…ipse-cdt#855) When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
…ipse-cdt#835) When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
…ipse-cdt#835) _This commit adds to eclipse-cdt#840 7bd8d52 to apply the same fix to another place that does the same operation on all fds._ When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
_This commit adds to #840 7bd8d52 to apply the same fix to another place that does the same operation on all fds._ When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
…ipse-cdt#835) When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com> (cherry picked from commit 7bd8d52)
…ipse-cdt#835) _This commit adds to eclipse-cdt#840 7bd8d52 to apply the same fix to another place that does the same operation on all fds._ When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com> (cherry picked from commit 3875408)
…ipse-cdt#835) When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com> cherry picked and squashed from commits: - 7bd8d52 - 24d9bd1 - 3875408
…ipse-cdt#835) When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com> cherry picked and squashed from commits: - 7bd8d52 - 24d9bd1 - 3875408
When _SC_OPEN_MAX (max nr of open files limit per process) is a very big number, then closing all possible file handles can take a while. This change first tries to use the syscall close_range() if available, falling back to use /proc/self/fd to close only open file handles, and lastly falling back to the old way of closing all possible handles one after another. In general, the first or second approach should be available which speeds up the pty spawning. Refs JetBrains/pty4j#147 Copied from JetBrains/pty4j@04685d8 (which is EPL 1.0) Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com> cherry picked and squashed from commits: - 7bd8d52 - 24d9bd1 - 3875408
We observed that it took very long time to open a JetBrains terminal in the new Amazon AL2023 VM. The CPU usage is 100% for process
PtyProcess Reap
(the full name of that thread isPtyProcess Reaper for [/bin/bash, --rcfile, /home/owner/.cache/JetBrains/RemoteDev/dist/ideaIU-2022.3.2/plugins/terminal/jediterm-bash.in, -i]
).strace -p PID
indicates that JNA call was trying to close a huge range of FDs, which should be defined in exe_pty.c. If_SC_OPEN_MAX
holds a big value, the loop would degrade the performance.The similar issue has been reported in other projects, such as
Wondering should we apply a similar patch as netdata/netdata#14213 to the impacted codes.
The text was updated successfully, but these errors were encountered: