Bug 188991 - Memory consumption keeps increasing when using XMLHttpRequest and importNode()
Summary: Memory consumption keeps increasing when using XMLHttpRequest and importNode()
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-06 23:36 UTC by Maarten ter Huurne
Modified: 2023-01-07 05:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test case: HTML page (943 bytes, text/html)
2009-04-06 23:37 UTC, Maarten ter Huurne
Details
Test case: XML data (17.66 KB, application/xml)
2009-04-06 23:38 UTC, Maarten ter Huurne
Details
Test case: test data generator script (373 bytes, text/x-python)
2009-04-06 23:39 UTC, Maarten ter Huurne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten ter Huurne 2009-04-06 23:36:39 UTC
Version:           4.2.1 (KDE 4.2.1) "release 104" (using 4.2.1 (KDE 4.2.1) "release 104", KDE:KDE4:Factory:Desktop / openSUSE_11.1)
Compiler:          gcc
OS:                Linux (x86_64) release 2.6.27.19-3.2-default

Please put the attached "TableRefresh.html" and "table.xml" on a local test web server, then load "TableRefresh.html" in Konqueror and observe the memory usage of the process. It will steadily rise and keep rising, sometimes pausing for a short time but never stopping. It reached 360MB here when I killed it.

The memory use will increase faster if the loaded data is larger, you can use the attached "tablegen.py" to create larger and smaller test data.

I managed to work around the issue by reusing the XMLHttpRequest object instead of creating a new one for each request.

I tested this on Konqueror 4.2.1 and 4.2.2, both have the problem.

I reported an issue in Chrome with very similar symptoms, but it is not exactly the same (workarounds are different). Here is the link in case it is interesting for you:
http://code.google.com/p/chromium/issues/detail?id=9765
Comment 1 Maarten ter Huurne 2009-04-06 23:37:25 UTC
Created attachment 32667 [details]
Test case: HTML page
Comment 2 Maarten ter Huurne 2009-04-06 23:38:09 UTC
Created attachment 32668 [details]
Test case: XML data
Comment 3 Maarten ter Huurne 2009-04-06 23:39:55 UTC
Created attachment 32669 [details]
Test case: test data generator script
Comment 4 Maksim Orlovich 2009-04-07 00:37:49 UTC
Part of the issue is GC not knowing to run, which is addressed by:
--- ecma/xmlhttprequest.cpp     (revision 947878)
+++ ecma/xmlhttprequest.cpp     (working copy)
@@ -22,8 +22,8 @@
 #include "xmlhttprequest.lut.h"
 #include "kjs_window.h"
 #include "kjs_events.h"
+#include <kjs/collector.h>

-
 #include "dom/dom_doc.h"
 #include "dom/dom_exception.h"
 #include "dom/dom_string.h"
@@ -168,6 +168,9 @@
        responseXML->close();

        typeIsXML = true;
+
+       // Tell GC that we have something fat...
+       Collector::reportExtraMemoryCost(response.length()/8);
       } else {
        typeIsXML = false;
       }


.. but that's still not enough.
Comment 5 Andrew Crouthamel 2018-11-02 04:28:48 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Andrew Crouthamel 2018-11-16 02:48:12 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 7 Justin Zobel 2022-12-08 23:51:10 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 8 Bug Janitor Service 2022-12-23 05:22:39 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2023-01-07 05:25:25 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!