Skip to content

Commit

Permalink
add static field for gc when sdk runs in multiple classloader
Browse files Browse the repository at this point in the history
  • Loading branch information
tangyoupeng committed Jun 29, 2023
1 parent 3b978cb commit c8c4d7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/java/src/main/java/io/juicefs/utils/BgTaskUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

public class BgTaskUtil {
private static final Logger LOG = LoggerFactory.getLogger(BgTaskUtil.class);

private static BgTaskUtil staticFieldForGc = new BgTaskUtil();
private static final ScheduledExecutorService threadPool = Executors.newScheduledThreadPool(2, r -> {
Thread thread = new Thread(r, "Background Task");
thread.setDaemon(true);
Expand Down

0 comments on commit c8c4d7d

Please sign in to comment.