Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory usage #61

Open
1 of 2 tasks
ringsaturn opened this issue Nov 10, 2022 · 1 comment
Open
1 of 2 tasks

Reduce memory usage #61

ringsaturn opened this issue Nov 10, 2022 · 1 comment

Comments

@ringsaturn
Copy link
Owner

ringsaturn commented Nov 10, 2022

  • 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

@ringsaturn ringsaturn changed the title Reduce init memory usage Reduce memory usage Nov 10, 2022
@ringsaturn
Copy link
Owner Author

ringsaturn commented Nov 12, 2022

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant