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

[react-jss] Memory leak from CSS transforms #801

Open
HenriBeck opened this issue Aug 3, 2018 · 5 comments
Open

[react-jss] Memory leak from CSS transforms #801

HenriBeck opened this issue Aug 3, 2018 · 5 comments
Labels
question Documentation is not good enough.

Comments

@HenriBeck
Copy link
Member

From @josh-stevens on June 1, 2018 19:29

Hi,

So I'm doing a long running animation using CSS transforms. It's a digital signage application so this is something that runs for hours on end. After about 12 hours or so, the application was eating 2.5GB of memory.

I did some profiling and it looks like JSS is the culprit. Here's a picture of what it's holding onto after 5 minutes.

screen shot 2018-06-01 at 2 00 35 pm

There are only 8 objects with their styles being updated. It updates the props every animation frame so about 60 times per second. Once those styles have been applied for their frame, they aren't needed anymore and should be discarded/gc'd. But as shown in the screenshot, I'm looking at Snapshot 6 (taken 5 minutes after Snapshot 1) and it's holding on to all those strings allocated between Snapshot 1 and Snapshot 2.

If I remove JSS from the equation and do the transform as an inline style, the snapshots don't blow up the way they do here. That's a fine workaround for my purposes, but thought I would at least raise the issue here. Why is JSS holding onto all the strings it creates?

Copied from original issue: cssinjs/react-jss#253

@HenriBeck HenriBeck added the question Documentation is not good enough. label Aug 3, 2018
@HenriBeck
Copy link
Member Author

From @kof on June 1, 2018 19:36

Hey, an interesting issue, but I doubt we can look into it without any reproducible example.

@HenriBeck
Copy link
Member Author

From @josh-stevens on June 1, 2018 19:46

Sure, I'll try to put together a simple example when I have a moment.

@HenriBeck
Copy link
Member Author

From @kof on June 1, 2018 19:48

Ideally with the least amount of dependencies. For e.g. if you can make a demo with just jss without any integrations or plugins, that would be easier to track down.

@HenriBeck
Copy link
Member Author

So you are using functional values, right? Can't you do the transform with css animations?

Sent with GitHawk

@HenriBeck
Copy link
Member Author

From @kof on June 19, 2018 20:0

@josh-stevens any updates?

@HenriBeck HenriBeck changed the title Memory leak from CSS transforms [react-jss] Memory leak from CSS transforms Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Documentation is not good enough.
Projects
None yet
Development

No branches or pull requests

1 participant