Reproducible example
https://github.com/zhuscat/expo-test-healthkit-lib
Steps to reproduce
As shown in the image, first tap “Request HealthKit Permission” to authorize. After tapping “Fetch Workout Data” once, memory usage is about 200 MB (I have 490 workouts and 43 000+ heart-rate data points). Then I rapidly tap “Fetch Workout Data” and watch memory climb in Xcode. When it reaches 1 GB I stop tapping, wait until CPU usage drops to a low level, and continue observing; the memory never falls back to 200 MB.
Memory usage after first tap

Keep tap until memory usage achieve 1G

Stop tapping but memory usage never falls back to 200MB

Reproducible example
https://github.com/zhuscat/expo-test-healthkit-lib
Steps to reproduce
As shown in the image, first tap “Request HealthKit Permission” to authorize. After tapping “Fetch Workout Data” once, memory usage is about 200 MB (I have 490 workouts and 43 000+ heart-rate data points). Then I rapidly tap “Fetch Workout Data” and watch memory climb in Xcode. When it reaches 1 GB I stop tapping, wait until CPU usage drops to a low level, and continue observing; the memory never falls back to 200 MB.
Memory usage after first tap
Keep tap until memory usage achieve 1G
Stop tapping but memory usage never falls back to 200MB