GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SelectorManager threads stay open after remote command execution and even after closing RemoteDatabase · Issue #2458 · ArcadeData/arcadedb

SelectorManager threads stay open after remote command execution and even after closing RemoteDatabase #2458

New issue
Copy link
New issue
Copy link
Closed
Bug
Closed
SelectorManager threads stay open after remote command execution and even after closing RemoteDatabase#2458
Bug
Copy link
Assignees
lvca
Milestone
25.8.1

Description

@achim-haeberle-fnt
achim-haeberle-fnt
opened on Aug 29, 2025
Issue body actions

ArcadeDB version: 25.6.1-java17

Running on Windows11 with java:
OpenJDK Runtime Environment Temurin-17.0.16+8 (build 17.0.16+8)
OpenJDK 64-Bit Server VM Temurin-17.0.16+8 (build 17.0.16+8, mixed mode, sharing)

When running a program which executes many requests with different threads (or different RemoteDatabase objects) the HttpClient-x-SelectorManager threads keep piling up until you get an out of memory error on client side. The cause for this seems to be a bug in the JDK (see https://bugs.openjdk.org/browse/JDK-8308364 and https://bugs.openjdk.org/browse/JDK-8308691). It unfortunately cannot be solved properly on client side.

See example ArcadeDBTest.java which does not lead to an out of memory as the number is not high enough, but with a profiler like visualvm you can see the 500 leftover threads.

A "dirty" workaround would be to add something like the following code to the close() mehtod of the RemoteDatabase, but I'm not convinced that this is a good solution (obviously ;)):

Field clientImplField = Class.forName("jdk.internal.net.http.HttpClientFacade").getDeclaredField("impl");
clientImplField.setAccessible(true);
Object clientImpl = clientImplField.get(httpClient);
Field selmgrField = Class.forName("jdk.internal.net.http.HttpClientImpl").getDeclaredField("selmgr");
selmgrField.setAccessible(true);
Thread selmgr = (Thread) selmgrField.get(clientImpl);
selmgr.interrupt();

Reacted by Dominik Bergen, Vladimir Trandafilov, Hanna Ostrovska, Tetiana Dibrova and Ruslan Butyk

Activity

  1. lvca
    self-assigned this
    on Sep 3, 2025
  2. lvca
    added a commit that references this issue on Sep 3, 2025

    fix: close http client on remote db close

    a8756c9
  3. lvca commented on Sep 7, 2025

    @lvca
    lvca
    on Sep 7, 2025
    Member
    More actions

    I implemented something close to your proposal. Unfortunately there is no way to close the thread in clean way with Java17.

  4. lvca
    closed this as completedon Sep 7, 2025
  5. lvca
    added this to the 25.8.1 milestone on Sep 7, 2025
  6. lvca
    added the
    Bug
    issue type on Sep 7, 2025
  7. lvca
    added
    bug
    on Sep 7, 2025
  8. mergify
    added a commit that references this issue on Mar 13, 2026

    chore(deps): bump https://github.com/pycqa/isort from 7.0.0 to 8.0.1 …

    219f8f8
  9. mergify
    added a commit that references this issue on Jun 21, 2026

    chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 [skip ci]

    791696f
  10. tae898
    added 2 commits that reference this issue on Jun 28, 2026

    fix: close http client on remote db close

    af88766

    chore(deps): bump https://github.com/pycqa/isort from 7.0.0 to 8.0.1 …

    07f70dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

No labels
No labels

Type

Bug

Projects

No projects

    Milestone

    • 25.8.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.