This repository was archived by the owner on Jan 4, 2023. It is now read-only.
Commit 0194377
Fix java objects memory leak
Objects created by jni->NewObject inside callback code blocks
are not being released by the JVM as there is still a reference to the object.
Those object references are accumulated on the thread stack and
eventually occupy all the available space in the heap.
Deleting the LocalReference as soon as the object is no longer required allows
the GC to dispose those temporary objects
Signed-off-by: Tzafrir Poupko <[email protected]>1 parent fcf01db commit 0194377
File tree
4 files changed
+14
-0
lines changed- java/jni
4 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| |||
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| |||
497 | 499 | | |
498 | 500 | | |
499 | 501 | | |
| 502 | + | |
500 | 503 | | |
501 | 504 | | |
502 | 505 | | |
| |||
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
| 636 | + | |
633 | 637 | | |
634 | 638 | | |
635 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
| 496 | + | |
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
| |||
582 | 584 | | |
583 | 585 | | |
584 | 586 | | |
| 587 | + | |
585 | 588 | | |
586 | 589 | | |
587 | 590 | | |
| |||
672 | 675 | | |
673 | 676 | | |
674 | 677 | | |
| 678 | + | |
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
| |||
742 | 746 | | |
743 | 747 | | |
744 | 748 | | |
| 749 | + | |
745 | 750 | | |
746 | 751 | | |
747 | 752 | | |
| |||
945 | 950 | | |
946 | 951 | | |
947 | 952 | | |
| 953 | + | |
948 | 954 | | |
949 | 955 | | |
950 | 956 | | |
| |||
1055 | 1061 | | |
1056 | 1062 | | |
1057 | 1063 | | |
| 1064 | + | |
1058 | 1065 | | |
1059 | 1066 | | |
1060 | 1067 | | |
| |||
1147 | 1154 | | |
1148 | 1155 | | |
1149 | 1156 | | |
| 1157 | + | |
1150 | 1158 | | |
1151 | 1159 | | |
1152 | 1160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
0 commit comments