Skip to content

ReflectiveTypeAdapterFactory.BoundField.write memory overhead #2321

@sembseth

Description

@sembseth

Problem solved by the feature

Reduced memory allocation when serializing data.

Feature description

Whenever a BoundField is written a new TypeAdapterRuntimeTypeWrapper is constructed. As far as I can tell the TypeAdapterRuntimeTypeWrapper could just as well be constructed as a final variable outside of the write method. When re-using Gson instances this will reduce the total amount of memory allocated during serialization.

gson_memory_overhead

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