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

Bug: Very high memory usage when dynamically updating tables. #762

Closed
orwant opened this issue May 9, 2015 · 15 comments
Closed

Bug: Very high memory usage when dynamically updating tables. #762

orwant opened this issue May 9, 2015 · 15 comments

Comments

@orwant
Copy link
Collaborator

orwant commented May 9, 2015

What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1. Open the attached HTML file in your browser and watch the memory usage rise very
quickly (measured in MB/s).  There seems to be a problem in Table.draw(), every time
the table is drawn memory is unable to be reclaimed.

Note that the attached HTML file updates the table every 0.1s which is more quickly
than my application does, but this high rate makes it very easy to reproduce.  With
a slower rate (1s) my browser crashes after having the page open for a few hours.

It should also be noted that forcing garbage collection will not lower the memory usage.
 However, the memory is reclaimed after navigating to another page, assuming the browser
hasn't already crashed.

If there is any more information you need to debug this please don't hesitate to contact
me.  I would like to get this resolved as quickly as possible as our users don't appreciate
their browsers crashing.

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
Table


Are you using the test environment (version 1.1)?
(If you are not sure, answer NO)
No


What operating system and browser are you using?
Windows 7 x64 with Chrome 16.0.912.63 m


*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by steventwheeler on 2011-12-19 20:07:09


- _Attachment: [test2.html](https://storage.googleapis.com/google-code-attachments/google-visualization-api-issues/issue-762/comment-0/test2.html)_
@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

I just noticed that the Prototype script links to an internal version.  You can just
replace '/scripts/prototype.js' with 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js'.

Original issue reported on code.google.com by steventwheeler on 2011-12-19 20:10:13

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Since there doesn't seem to be any indication that this will be fixed soon is there
source code available so that I can try to fix this myself?

Original issue reported on code.google.com by steventwheeler on 2011-12-30 17:47:19

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

We hope that this would be fixed soon, in the upcoming release.

Original issue reported on code.google.com by metula on 2012-01-02 09:07:37

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

I have noticed that this issue seems to be fixed.  I am just wondering if it is actually
fixed or if we need to keep our workaround in place?

Original issue reported on code.google.com by steventwheeler on 2012-07-03 19:01:36

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Using the 15th of May 2013 release I still have this issue. 

Attached is a screenshot of the google chrome memory profile, and some google visualisation
code to demo the problem. It seems that some DOM elements and event listeners are never
released. 

Is the code open sourced? So I can look a this myself I could really do with this being
resolved quiet quickly. 

Original issue reported on code.google.com by colinbul on 2013-05-28 10:27:37


- _Attachment: MemoryLeak_screenshot.png
![MemoryLeak_screenshot.png](https://storage.googleapis.com/google-code-attachments/google-visualization-api-issues/issue-762/comment-5/MemoryLeak_screenshot.png)_ - _Attachment: [Google_Vis_Playground_Code.txt](https://storage.googleapis.com/google-code-attachments/google-visualization-api-issues/issue-762/comment-5/Google_Vis_Playground_Code.txt)_

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

I am seeing the memory grow, but only while there is memory available, and not permanently.
 I don't see an always rising event listener count, for example, but it rises and falls.
 Memory rises and falls as well.  I am using Chrome 27.0.1453.93 on linux.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-05-29 14:26:19

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

You can close issue 436, issue 209, issue 1313, issue 1225, issue 1073 and issue 1276
as duplicates of this issue.

To summarize, continuously calling theChartObject.draw(...) causes memory growth, with
just about any type of chart.
Continuously forcing a garbage collection (using the Timeline panel of the Google Chrome
Developer Tools) makes the memory grow a bit slower, but growth is exhibited nevertheless.

This happens in Google Chrome 30 and in Firefox. Note that in Firefox the memory does
not grow quickly, but it still grows.

An example of a page that has a real memory issue due to this problem is the Real Time
Google Analytics overview page -
https://www.google.com/analytics/web/?hl=en#realtime/rt-overview
Which seems to be using the Google Visualization API as well and redrawing its charts
every second or less.
In a little more than half an hour, the memory grows to over 640,000 KB (without forcing
a garbage collection), even when there is no new data.

Note that you must be logged in and have an active website profile, otherwise the page
is not available.

See issue chromium:306154, issue chromium:140028 and issue chromium:159038 for details.

Original issue reported on code.google.com by phistuck on 2013-10-11 11:52:19

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Thanks for your report, and summary of prior duplicate and related issues.

We recently did a lot of work to clean up memory leaks and the next release should
resolve most if not all issues. (I haven't found any more leaks, but there always could
be more hiding in various corners I haven't found.) 

You should be able to see these fixes now if you load version 1.1 of google charts.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-10-11 12:16:34

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

I tried it and saw a great improvement!

Google Analytics seems to be loading 1, not 1.1. Can you contact their team and help
them update to 1.1? The leak is very harsh in this specific case.

(I did it myself using the Developer Tools and there seemed to be a great improvement)

Or will "1" load this "1.1" version once it gets released?

Thank you for the prompt response!

Original issue reported on code.google.com by phistuck on 2013-10-11 14:00:07

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Yes, "1", which always loads 1.0, will eventually load what is now 1.1 once it is released
so that replaces the 1.0 version. This rollover may happen in another week or so, assuming
we have stabilized things well enough.

Please do let us know if you find any more leaks.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-10-11 14:34:08

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Issue 1276 has been merged into this issue.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-10-11 19:41:23

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

When is this "1.1" release happening?  Is there any way I can enable it on my site right
now?  I'm speaking in terms of the Google Analytics Real-time Overview page, which
is still suffering from this issue.

Original issue reported on code.google.com by RobinsonAaronD on 2013-11-13 15:43:10

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

If the Google Analytics page with charts is not loading 1.1 now, they may have their
reasons for it.  (I missed that part of phistruck's question earlier.)  I try to make
sure they are aware of the situation.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-11-13 19:26:58

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

The page for the bug in Chromium says this issue is fixed (https://code.google.com/p/chromium/issues/detail?id=140028)
 however, GA RealTime Analytics still leaks and crashes after the window is open for
more than 30 minutes. Depending on the system/browser/device the crash time differs.

You mentioned you would let them know, but the their bug is listed as closed referring
to this post,  you can see  kenjibaheux@chromium.org  comment at the bottom of the
bug page.

Original issue reported on code.google.com by pat.grady on 2013-11-22 21:24:21

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

@pat.grady -
The issue is indeed closed, in both of these issue trackers, because the underlying
issues of the dependent products (if any) were fixed.
- Chromium currently has no issue (it apparently had an issue, but that was fixed a
while ago), because it reproduces in other browsers - it is a Google Analytics issue.
- Google Visualization fixed their issue in a subsequent release (1.1).
- Google Analytics has not updated the code to use the new, leak free (in this sense,
anyway) 1.1 API.

So, basically, if Google Analytics has an issue tracker, this issue should be open
there. I do not believe there is an official issue tracker, so you will just have to
nag them in a discussion or support group (if such group exists).

Other than that, the (underlying) issue is indeed fixed.

Original issue reported on code.google.com by phistuck on 2013-11-22 21:34:29

@orwant orwant closed this as completed May 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant