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

Memory Leak | Bloom

Open pixelass opened this issue 2 years ago • 1 comments

As described in #68 there's a memory leak when updating the intensity of Bloom

Here's our reproduction:

https://codesandbox.io/s/mystifying-kare-k4lh3b?file=/src/App.js

useFrame(() => {
  if (bloomRef.current && intensityRef.current) {
      bloomRef.current.intensity = intensityRef.current;
  }
});

Screencast: (Activity Monitor > View > Update Frequency > Very Often (1sec)

Bloom_Memory_Leak

pixelass avatar May 27 '22 20:05 pixelass

maybe related discussion/cause here

chasedavis avatar Jun 22 '22 06:06 chasedavis

Was there ever a solution created for this issue? I am running into the same issue within my project.

cmrnfaith avatar Oct 13 '22 18:10 cmrnfaith

Was there ever a solution created for this issue? I am running into the same issue within my project.

Not to my knowledge. If you use postprocessing directly it's avoidable though.

chasedavis avatar Oct 13 '22 21:10 chasedavis

What do you mean by "directly"?

max-hans avatar Apr 24 '23 20:04 max-hans

@max-hans this library (react-postprocessing) is a thin react abstraction over postprocessing. If you use postprocessing API's directly instead of this library you will likely not run into this issue (but will also have to do lifecycle management yourself).

chasedavis avatar Apr 25 '23 00:04 chasedavis