react-spring icon indicating copy to clipboard operation
react-spring copied to clipboard

AnimatedValue Memory Leak

Open derindutz opened this issue 7 years ago • 6 comments

🐛 Bug Report

AnimatedValues are being created but not deleted when using nextjs and SSR.

https://spectrum.chat/react-spring/general/animated-component-is-causing-memory-leak~1190af03-e0c9-4e6d-9d07-1419581424a2 may be relevant.

To Reproduce

Create an AnimatedValue (animated.div) server-side using nextjs.

Expected behavior

The AnimatedValues are properly cleaned up.

Environment

  • react-spring ^v8.0.18
  • react ^v16.8.0
react-spring memory leak

derindutz avatar May 20 '19 22:05 derindutz

The same seems to happen with useTransition. Left a Next.js site with a useTransition carousel (that switches slides every 8 seconds) open overnight, Chrome stopped the site due to out-of-memory exception.

See this image: https://d.pr/i/PO1PYy

Tarpsvo avatar May 29 '19 07:05 Tarpsvo

This is happening to me also.

ShanonJackson avatar Jun 09 '19 22:06 ShanonJackson

Please try with react-spring@next. 👍

If that doesn't work, run @react-spring/envinfo and create a gist with the output like this. Then paste that link here. Thanks!

aleclarson avatar Jun 09 '19 22:06 aleclarson

Hello there, We have the same issue here. react-spring@next fixed it and I did not see any regression (yet).

Thanks @aleclarson

VincentCtr avatar Jun 17 '19 11:06 VincentCtr

Hi, is it possible that you still fix this bug in v8? We also have this problem and cannot update to v9beta due to other bugs.

v-Bauer avatar Feb 18 '20 16:02 v-Bauer

After upgrading to latest v9 version our memory usage stabilized. We've had this memory leak for a long time, and it took a while for us to figure out it was because of this lib. image

marcusthelin avatar Nov 23 '21 08:11 marcusthelin