Skip to content

Reduce memory usage #61

@ringsaturn

Description

@ringsaturn
Owner
  • The DefaultFinder will not use probuf timezone data, so just not save it when necessary
  • After NewFinder from bin data, the allocs/heap will increase to a large number, but after GC, heap will reduce to far less. Maybe it’s possible to use sync.Pool to reduce init memory usage.

TODO

  • Not save probuf timezone in memory for DefaultFinder add finder opt to reduce mem when not need #60
    Add sync.Pool for init

Activity

changed the title [-]Reduce init memory usage[/-] [+]Reduce memory usage[/+] on Nov 10, 2022
ringsaturn

ringsaturn commented on Nov 12, 2022

@ringsaturn
OwnerAuthor

2022-11-12 update

Using sync.Pool seems not work since most memory cost came from Unmarshall bytes from tzf-rel’s large bytes var.

Need check other data formats which don’t require load all data to memory at 1 time when unmarshall, or change the init way with a for loop over lots smaller bytes to use sync.Poll


#64 will force run GC after init, at least memory seems smaller than before, but still require 150MB for init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ringsaturn

        Issue actions

          Reduce memory usage · Issue #61 · ringsaturn/tzf