Libraryless. Click here for Pure Java version (2139L/14K).
1 | static volatile long gc_memoryUsedAfterGC; |
2 | static volatile long gc_lastStart; |
3 | static volatile long gc_duration; |
4 | static Lock gc_lock = lock(); |
5 | |
6 | static void gc() { |
7 | callOpt(javax(), 'cleanWeakMaps); |
8 | { |
9 | lock gc_lock; |
10 | gc_lastStart = sysNow(); |
11 | System.gc(); |
12 | gc_duration = sysNow()-gc_lastStart; |
13 | gc_memoryUsedAfterGC = usedMemory(); |
14 | } |
15 | vmBus_send('gcDone); |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005962 |
Snippet name: | gc - trigger Java's garbage collector & clean weak maps |
Eternal ID of this version: | #1005962/7 |
Text MD5: | eb7c38b1558c34347c3dd0d926fdba5c |
Transpilation MD5: | 6c55d4523c48b0fc1143f0533c42f82a |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-13 11:25:35 |
Source code size: | 391 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 672 / 779 |
Version history: | 6 change(s) |
Referenced in: | [show references] |