Skip to content

Commit 2a83de1

Browse files
SyncCredentialsToken: clarify GC note of clear applies to Strings only
1 parent 08a4b24 commit 2a83de1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

objectbox-java/src/main/java/io/objectbox/sync/SyncCredentialsToken.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ public byte[] getTokenBytes() {
6262
/**
6363
* Clear after usage.
6464
* <p>
65-
* Note that actual data is not removed from memory until the next garbage collector run.
66-
* Anyhow, the credentials are still kept in memory by the native component.
65+
* Note that when the token is passed as a String, that String is removed from memory at the earliest with the next
66+
* garbage collector run.
67+
* <p>
68+
* Also note that while the token is removed from the Java heap, it is present on the native heap of the Sync
69+
* component using it.
6770
*/
6871
public void clear() {
6972
cleared = true;

0 commit comments

Comments
 (0)