karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rovarga <...@git.apache.org>
Subject [GitHub] karaf pull request #377: Clean up object duplication
Date Tue, 26 Sep 2017 17:05:38 GMT
GitHub user rovarga opened a pull request:


    Clean up object duplication

    This series of patches are attempts to improve resolver memory usage, which we have
    observed to go up to ~2GB while performing a mass install of all OpenDaylight features.
    A large-ish part of this are duplicated Strings and Maps.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rovarga/karaf dup-objects

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #377
commit bf46b42362a4a35f3c35eb380ba18d8991505f59
Author: Robert Varga <nite@hq.sk>
Date:   2017-09-26T14:40:38Z

    Clean SimpleFilter up
    Profiling OpenDaylight SFT has turned up large memory usage when
    a lot of features are created. Some of the memory wasted is in
    over-allocated ArrayLists, which are using default pre-allocation
    This patch uses Collections.singletonList() to hold NOT operation
    arguments and reduces pre-allocation for other compound operations
    to 2.
    Signed-off-by: Robert Varga <nite@hq.sk>

commit 71b10223ba7c1cfc955eea11dd6f91d0f3304fa8
Author: Robert Varga <nite@hq.sk>
Date:   2017-09-26T15:20:10Z

    Deduplicate common OSGi filter strings
    Based on a heap dump with a large number of features/bundles,
    5 strings have a large number of duplicates -- ~48K duplicate strings,
    wasting ~1.9MiB of memory.
    Create a small interning Map, which can normalize these, squashing
    a number of these duplicates.
    Signed-off-by: Robert Varga <nite@hq.sk>

commit 427e9f23c9103db94fbb82e163cbef4eb7ed890b
Author: Robert Varga <nite@hq.sk>
Date:   2017-09-26T15:54:02Z

    Improve ResourceBuilder's use of maps
    Do not instatiate an empty HashMap where Collections.emptyMap()
    does the same. Also reuse default directives map, now backed by
    a Collections.singletonMap().
    Signed-off-by: Robert Varga <nite@hq.sk>

commit 975e9239336b050155f93b192d6ee626920cdb97
Author: Robert Varga <nite@hq.sk>
Date:   2017-09-26T16:36:33Z

    Reuse empty SimpleFilter
    Rather than instantiating a new filter, use a precomputed constant.
    This eliminates constructor calls from outside of the package, allowing
    it be be hidden.
    Signed-off-by: Robert Varga <nite@hq.sk>



View raw message