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

Doubling the WebGLBlock.backingScale takes too much memory #859

Closed
jessegreenberg opened this issue Sep 13, 2018 · 6 comments
Closed

Doubling the WebGLBlock.backingScale takes too much memory #859

jessegreenberg opened this issue Sep 13, 2018 · 6 comments
Assignees

Comments

@jessegreenberg
Copy link
Contributor

Found in phetsims/energy-skate-park-basics#435. WebGLBlock has these lines:

      // Double the backing scale size if we detect no built-in antialiasing.
      // See https://github.com/phetsims/circuit-construction-kit-dc/issues/139
      if ( gl.getParameter( gl.SAMPLES ) === 0 ) {
        this.backingScale *= 2;
      }

In phetsims/energy-skate-park-basics#435 it was discovered that this causes energy-skate-park-basics to crash consistently on iPad2, presumably because of extra memory usage.

@jonathanolson is there a way we could make this optional higher up, maybe in WebGLNode or something?

@jonathanolson
Copy link
Contributor

I'm partially curious about whether we could investigate memory usage of the sim (and wouldn't need to make this type of change).

Alternatively, if we need to disable/change this, it would be best as a Display setting (providing a sim option in the -main.js). It would be somewhat complicated to set a flag or setting on each node that constrains the settings of WebGL blocks that it is displayed in.

I'll plan to add a Display/Sim setting to disable this for now, and later we could look into the memory usage?

@jonathanolson
Copy link
Contributor

@jessegreenberg can you try providing allowBackingScaleAntialiasing: false in ESPB options, to ensure that it properly "turns off" the doubling?

@jessegreenberg
Copy link
Contributor Author

The option works great @jonathanolson, thanks.

I'm partially curious about whether we could investigate memory usage of the sim

It would be great to do this, can you please elaborate on what you have in mind? Or maybe we could schedule a time to discuss?

@jonathanolson
Copy link
Contributor

I believe we discussed memory in general, let me know if there's anything more I can do to help.

@jessegreenberg
Copy link
Contributor Author

Thanks @jonathanolson, yes we did. And the added option is very helpful. This issue can be closed.

@jessegreenberg
Copy link
Contributor Author

jessegreenberg commented Mar 19, 2020

From review comment asking about this, this can now be removed since we are not using WebGL and we are no longer targeting iPad2. I tested the sim for several minutes on an iPad 3 and saw no crashing or memory related failures.

EDIT: Oops, I meant to put this in the sim issue, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants