-
Notifications
You must be signed in to change notification settings - Fork 2
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
memory usage seems high #91
Comments
The latest dev release if v1.0.0-dev.23, available at http://www.colorado.edu/physics/phet/dev/html/expression-exchange/1.0.0-dev.23/expression-exchange_en.html. I'm first going to test the memory usage at startup. The procedure is:
Chrome Version (from
Two trials on the current master RequireJS version have the following values:
So, it's a bit higher in master+RequireJS, but less than 10% higher, so the high memory usage isn't due to some recent changes. |
I turned off the game screen using the |
I just tried Function Builder, which is a recently released four screen sim and found that its memory usage is 78.6 MB (just one trial), so this also makes it seem like Expression Exchange is perhaps within reason in terms of its memory usage. |
Marking for dev meeting. Do we have any guidelines or rules of thumb for memory usage? |
Recent testing for Graphing Lines (phetsims/graphing-lines#78 (comment)) showed ~35MB for just the "Line Game" screen. So I don't think that these numbers are all that surprising for Expression Exchange or any of the other sims noted above. |
Searching all of our repos for "MB" shows several hits that indicate prior memory test results: |
Discussed in the 5/18/2017 developer meeting and concluded that as long as it loads and runs on iPad 2, that should be a sufficient test. |
I just did several tests on a 16 GB iPad 2 running iOS 9.3.5 (the PhET device named "Witten"), and the sim loaded most of the time, but there were two instances (out of roughly 8) where Safari crashed. This makes me feel as though we are on the edge for memory usage. @jonathanolson has been assigned to do the code review, and he also offered to look for ways to reduce the number of nodes somewhat. Assigning to him for now, I'll take it back when he's done what he can do. |
@jbphet can this be removed from "developer meeting" label? |
Yes (done). |
As noted in #88, I believe the creation of nodes (particularly images) for every coin term (if I'm reading things correctly) in CoinNodeFactory may be the culprit. Using DAG patterns I believe should help a lot, as each Scenery Image node creates a DOM Image element, which depending on the browser may take up a sizable amount of memory. RichText also creates a lot of nodes, which is also an issue for the Area Model simulations that I'm working on. A general improvement may be helpful. Currently, by creating as many coins as I could on all screens, I was able to bump the number of nodes in the tree past 9000. @jbphet, collaboration on this issue would probably be best. |
Also will plan to check performance with @jbphet when it doesn't crash. |
@jbphet @jonathanolson, 1.1.0-dev.4 is not crashing on an iPad 2. Each screen was filled with max terms and the game was completed multiple time. That's not to say the sim didn't slow down, however (was still usable). |
Since this now works on iPad 2 and doesn't appear to leak memory, I'm closing this issue. |
I was working on checking for memory leaks, and was seeing memory usage under Chrome at about 60-70 MB. I just did a bit more testing and found the usage to now be around 85 MB. The odd thing is that I went and checked a previously released dev version and found its memory usage to be about the same, so I'm wondering if something recently changed in Chrome that causes it to use more memory.
At any rate, I'd like to get a handle on this in order to figure out if I need to reduce the memory usage and, if so, how. I'll start by collecting some data.
The text was updated successfully, but these errors were encountered: