This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] create BEP connection on demands instead of keeping it as a…
… service (#356) Create BEP connection on demands instead of keeping it as a service - Background Significantly reduces memory footprint of the application, because the never-cleaned BepServer instance was holding a `BepOutputBuilder bepOutputBuilder` field which in turn was holding all BEP messages that has been received since the prevous build. So the reason for this change is: 1. There's no point of having a socket handle and other sources laying in memory, in particular because it's easy to make a mistake of keeping too much data. 2. BepServer setup is cheap 3. It will be easier to provide different peb handlers for different calls. - Memory footprint comparison The heap size in of this app in idle, for a project containing 2000 targets, is reduced from more than ~2GB to ~0.5GB. Bazel BSP 2.5.1 (idle, after 2000k targets import) ``` $ jcmd 11429 GC.heap_info 11429: garbage-first heap total 5382144K, used 3219933K [0x0000000673800000, 0x0000000800000000) region size 4096K, 40 young (163840K), 39 survivors (159744K) Metaspace used 45658K, committed 46016K, reserved 1097728K class space used 5045K, committed 5248K, reserved 1048576K $ jcmd 11429 GC.run 11429: Command executed successfully $ jcmd 11429 GC.heap_info 11429: garbage-first heap total 5382144K, used 2161982K [0x0000000673800000, 0x0000000800000000) region size 4096K, 0 young (0K), 0 survivors (0K) Metaspace used 45658K, committed 46016K, reserved 1097728K class space used 5045K, committed 5248K, reserved 1048576K ``` Bazel BSP now: ``` $ jcmd 9381 GC.heap_info 9381: garbage-first heap total 4001792K, used 2190915K [0x0000000673800000, 0x0000000800000000) region size 4096K, 48 young (196608K), 47 survivors (192512K) Metaspace used 46417K, committed 46784K, reserved 1097728K class space used 5114K, committed 5312K, reserved 1048576K $ jcmd 9381 GC.run 9381: Command executed successfully $ jcmd 9381 GC.heap_info 9381: garbage-first heap total 1900544K, used 556282K [0x0000000673800000, 0x0000000800000000) region size 4096K, 0 young (0K), 0 survivors (0K) Metaspace used 46417K, committed 46784K, reserved 1097728K class space used 5114K, committed 5312K, reserved 1048576K ```
- Loading branch information
1 parent
dd33bc2
commit 4252736
Showing
7 changed files
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters