Skip to content

fix(DepthOfField): cleanup memory leak - #233

Merged
CodyJasonBennett merged 5 commits into
pmndrs:masterfrom
dongho-shin:fix/dof-memory-leak
Aug 23, 2023
Merged

fix(DepthOfField): cleanup memory leak#233
CodyJasonBennett merged 5 commits into
pmndrs:masterfrom
dongho-shin:fix/dof-memory-leak

Conversation

@dongho-shin

@dongho-shindongho-shin commented Jul 29, 2023

Copy link
Copy Markdown
Contributor

Hi I found that DepthOfField Component has a Texture Memory leak
so I fix it in PR

you can check memory leak this codeSandbox
Every update of parameter, texture count increase infinitely

@dongho-shindongho-shin changed the title Fix/dof memory leakfix/dof memory leakJul 29, 2023
@dongho-shin

This comment was marked as resolved.

@v1rtl

Copy link
Copy Markdown
Member

the code seems ok (if I got it right it mostly disposes render targets) but could you also please create a sandbox demo with new DOF code? to test out the effect that it works correctly

Comment threadsrc/effects/DepthOfField.tsx Outdated
@dongho-shin

Copy link
Copy Markdown
ContributorAuthor

the code seems ok (if I got it right it mostly disposes render targets) but could you also please create a sandbox demo with new DOF code? to test out the effect that it works correctly

ok I will make it for test it

@dongho-shin

dongho-shin commented Aug 20, 2023

Copy link
Copy Markdown
ContributorAuthor

@talentlessguy Hi I made a code sandbox but it has a problem

Actually I fix memory leak by wrapping React Code because EffectComposer of '@react-three/postprocessing' can't get CustomEffect
so I use this way that below codesandbox
Wrapped Origin ReactComponent Version

Do you have any ideas? do i add a custom effect in wrong way?

I guess if that problem fixed, I'm quite sure it works under the sandbox
code sandbox
(custom effect didn't added in effect composer i don't know why 😢 )
BTW it works in this case (https://codesandbox.io/s/customeffect-zdcc7f?file=/src/App.tsx)

Comment threadsrc/effects/DepthOfField.tsx Outdated
Comment threadsrc/effects/DepthOfField.tsx Outdated
Comment threadsrc/effects/DepthOfField.tsx Outdated
@CodyJasonBennettCodyJasonBennett changed the title fix/dof memory leakfix(DepthOfField): cleanup memory leakAug 23, 2023
@CodyJasonBennett
CodyJasonBennett merged commit 49b082f into pmndrs:masterAug 23, 2023
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dongho-shin@v1rtl@CodyJasonBennett