Skip to content

Halve memory used by BloomFilter.java : readFrom() #5770

@pwr2c

Description

@pwr2c

guava/src/com/google/common/hash/BloomFilter.java

readFrom allocates a temporary bitmap (data) of the size required, fills it and then passes that to new LockFreeBitArray(data) which allocates the same amount of memory and copies the bitmap (data) which is then discarded.
If the bitmap (data) is say 100MB in size, then double that of memory used during this process (along with extra CPU in the copy).

The readFrom could allocate the LockFreeBitArray(data) itself and read the data directly into that bitmap instead of using a temporary intermediate bitmap.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions