[pgjdbc/pgjdbc] c40855: fix: reduce memory overhead of .finalize() methods...

Поиск
Список
Период
Сортировка
Искать

[pgjdbc/pgjdbc] c40855: fix: reduce memory overhead of .finalize() methods...

От:
Vladimir Sitnikov <noreply@github.com>
Дата:
  Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: c40855f14b1601c85222084d949856efbce9bbcc
      https://github.com/pgjdbc/pgjdbc/commit/c40855f14b1601c85222084d949856efbce9bbcc
  Author: Vladimir Sitnikov 
  Date:   2023-02-19 (Sun, 19 Feb 2023)

  Changed paths:
    M pgjdbc/src/main/java/org/postgresql/core/QueryExecutor.java
    M pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java
    A pgjdbc/src/main/java/org/postgresql/core/QueryExecutorCloseAction.java
    M pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java
    M pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java
    M pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
    A pgjdbc/src/main/java/org/postgresql/jdbc/PgConnectionFinalizeAction.java
    M pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java
    A pgjdbc/src/main/java/org/postgresql/util/StreamWrapperFinalizeAction.java
    M pgjdbc/src/test/java/org/postgresql/test/jdbc2/CopyTest.java

  Log Message:
  -----------
  fix: reduce memory overhead of .finalize() methods in PgConnection and StreamWrapper (#2817)

Previously, an abandoned PgConnection could retain a significant amount of heap.
Now the bare minimum is moved to a separate class, so the abandoned connections
can be removed from the heap earlier.

This does not remove the use of `.finalize()`, and it only reduces the amount of retained heap memory.

Fixes https://github.com/pgjdbc/pgjdbc/issues/1431
Fixes https://github.com/pgjdbc/pgjdbc/issues/1360




FAQ