webOS Nation Forums >  Homebrew >  webOS patches > [patch] Cleanup Event Listeners (fix webos 1.3.1 memory leak)
[patch] Cleanup Event Listeners (fix webos 1.3.1 memory leak)

  Reply
 
LinkBack Thread Tools Display Modes
Old 11/22/2009, 09:31 AM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 770
Likes Received: 0
Thanks: 37
Thanked 276 Times in 83 Posts
Default [patch] Cleanup Event Listeners (fix webos 1.3.1 memory leak)

This patch requires additional testing - but it seems to restore the old memory garbage collection method that was in webos versions before 1.3.1. In my testing (2 days worth), it fixed the memory leaks associated with using drPodder & Newsweek.

Please test - especially if you're frequently getting the too many cards error after updating to webos 1.3.1.

What it changes is

Code:
# Automatically remove eventlisteners from DOM nodes not attached to
# the render tree.
AutomaticallyCleanupEventListeners=false
to

Code:
# Automatically remove eventlisteners from DOM nodes not attached to
# the render tree.
AutomaticallyCleanupEventListeners=true #default is false
My observation on what that means is that garbage collection is cleaning up after apps instead of relying on the apps themselves to do it. But again, please test.. This is just based on 2 days of testing from me. (I was getting the too many cards error at least once or twice a day.. been running great for the past 2 days using this patch) (this might re-introduce the 300ms lag in games that some were complaining about in webos 1.2.1 - I never saw that lag so can't comment on that..)

-mark
Attached Files
File Type: patch CleanupEventListeners.patch (869 Bytes, 360 views) Email Attachment
diomark is offline   Reply With Quote
Old 11/22/2009, 09:44 AM   #2 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,883
Likes Received: 496
Thanks: 801
Thanked 12,956 Times in 1,495 Posts
Default

nice find diomark I'm excited to see others results on this one
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Old 11/22/2009, 10:12 AM   #3 (permalink)
Member
 
Join Date: Jun 2009
Location: Baltimore
Posts: 295
Likes Received: 0
Thanks: 106
Thanked 18 Times in 17 Posts
Default

Is this patch available via Preware or WebOS Quick Install?

I'm definetly getting the memory leak issues once or twice a day as well!
__________________
Qualcomm QCP 2700 -> ... Palm m125 ... -> Instinct -> Palm Pre

I tweet a lot about the Pre! @bshedwick
bjshedwick is offline   Reply With Quote
Old 11/22/2009, 11:05 AM   #4 (permalink)
Formerly Shadow-360
 
Adam Carr's Avatar
 
Join Date: Oct 2009
Posts: 664
Likes Received: 0
Thanks: 52
Thanked 344 Times in 116 Posts
Default

Thanks diomark!

One Q however, will this cause a partical split second lag in the UI when closing apps?
Adam Carr is offline   Reply With Quote
Old 11/22/2009, 03:02 PM   #5 (permalink)
Member
 
trim81's Avatar
 
Join Date: Jul 2005
Location: 626, Los Angeles
Posts: 2,726
Likes Received: 0
Thanks: 381
Thanked 197 Times in 129 Posts
Default

just installed it, hopefully it works..

the too many cards error has been very annoying in 1.3.1
trim81 is offline   Reply With Quote
Old 11/22/2009, 05:36 PM   #6 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,883
Likes Received: 496
Thanks: 801
Thanked 12,956 Times in 1,495 Posts
Default

Quote:
Originally Posted by bjshedwick View Post
Is this patch available via Preware or WebOS Quick Install?

I'm definetly getting the memory leak issues once or twice a day as well!
http://forums.precentral.net/canuck-...les-wosqi.html
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Thanked By: sudoer
Old 11/22/2009, 05:43 PM   #7 (permalink)
Member
 
Join Date: Jun 2009
Posts: 770
Likes Received: 0
Thanks: 37
Thanked 276 Times in 83 Posts
Default

Quote:
Originally Posted by Shadow-360 View Post
Thanks diomark!

One Q however, will this cause a partical split second lag in the UI when closing apps?
I haven't noticed any.. -m
diomark is offline   Reply With Quote
Old 11/22/2009, 09:04 PM   #8 (permalink)
Member
 
QuietStorm21A's Avatar
 
Join Date: Feb 2009
Location: Spring Valley, NY
Posts: 232
Likes Received: 0
Thanks: 79
Thanked 22 Times in 21 Posts
Default

i am also guessing this will also help the freezing & restarts?
__________________

QuietStorm21A is offline   Reply With Quote
Old 11/22/2009, 10:17 PM   #9 (permalink)
Patch Meister
 
dBsooner's Avatar
 
Join Date: Jan 2008
Location: Broken Arrow, OK
Posts: 280
Likes Received: 0
Thanks: 31
Thanked 579 Times in 92 Posts
Default

I have a question about this patch... This is from 1.2.1's /etc/palm/browser.conf:
Code:
AutomaticallyCleanupEventListeners=false
So this setting was also "false" in 1.2.1. That being said, how does changing this to "true" make it "like it was in 1.2.1"?
__________________
dBsooner
WebOS-Internals Member and Developer
Donations Appreciated!

Keep up to date with webOS-Patches via Twitter: @dBsooner

Browse Patches @ WebOS-Patches Web Portal - (Trac)
Submit New Patches @ WebOS-Patches Web Portal
Submit Updated Patches @ WebOS-Patches Web Portal
dBsooner is offline   Reply With Quote
Old 11/22/2009, 10:57 PM   #10 (permalink)
Member
 
Join Date: Jun 2009
Posts: 770
Likes Received: 0
Thanks: 37
Thanked 276 Times in 83 Posts
Default

Quote:
Originally Posted by dBsooner View Post
I have a question about this patch... This is from 1.2.1's /etc/palm/browser.conf:
Code:
AutomaticallyCleanupEventListeners=false
So this setting was also "false" in 1.2.1. That being said, how does changing this to "true" make it "like it was in 1.2.1"?
I just checked webosdr 1.2.1 - and you're right.. so it's not reverting to what webos 1.2.1 was necessarily doing.. But (in my experience) it is causing webos to cleanup memory a bit better.. I need to note - I did finally need to reboot tonight (after 3 days uptime..)

-mark
diomark is offline   Reply With Quote
Old 11/22/2009, 11:22 PM   #11 (permalink)
Member
 
Join Date: Oct 2005
Posts: 744
Likes Received: 0
Thanks: 63
Thanked 137 Times in 76 Posts
Default

After the update then installing newsroom, I found that the amount of webpages I could have open was reduced drastically for a few hours, until a few reboots, and now everything is pretty great memory wise.

I will give this app a shot and let you know if there is any difference.
Stihl is offline   Reply With Quote
Old 11/23/2009, 12:38 AM   #12 (permalink)
Member
 
Kev1000000's Avatar
 
Join Date: Jan 2006
Location: Troy, MI
Posts: 704
Likes Received: 5
Thanks: 43
Thanked 228 Times in 76 Posts
Default

Very interesting. I just spent 4 days trying to find 1 memory leak in my app Dealert because of this flag. Heh, this explains why it was randomly introduced in 1.2.1.

Nice find!
__________________
Developer of:

-------------------------------------
Discuss my apps in my developer forum
Kev1000000 is offline   Reply With Quote
Old 11/23/2009, 12:43 PM   #13 (permalink)
Member
 
Join Date: Jun 2009
Location: Baltimore
Posts: 295
Likes Received: 0
Thanks: 106
Thanked 18 Times in 17 Posts
Default

Anyone had negative effects b/c of this patch? Some rumblings on twitter about this causing bricking of Pres, enough to have to take to the Webos dr
__________________
Qualcomm QCP 2700 -> ... Palm m125 ... -> Instinct -> Palm Pre

I tweet a lot about the Pre! @bshedwick
bjshedwick is offline   Reply With Quote
Old 11/24/2009, 04:51 AM   #14 (permalink)
Member
 
Join Date: Jun 2009
Posts: 158
Likes Received: 0
Thanks: 3
Thanked 20 Times in 12 Posts
Default

what is oddfor me is that I have been getting random reboots ever since updating to 1.3.1

wondering if this could be related
__________________
Mobile photoblog http://post.jauderho.com/
jauderho is offline   Reply With Quote
Old 11/28/2009, 11:53 AM   #15 (permalink)
Moderator
 
jbg7474's Avatar
 
Join Date: Jan 2009
Location: SW Ohio
Posts: 3,858
Likes Received: 92
Thanks: 1,019
Thanked 1,061 Times in 715 Posts
Default

Is this patch going to be loaded in a feed that is read by Preware?
jbg7474 is offline   Reply With Quote
Old 12/05/2009, 09:57 AM   #16 (permalink)
Member
 
Join Date: Jul 2009
Location: North Carolina
Posts: 50
Likes Received: 0
Thanks: 16
Thanked 1 Time in 1 Post
Default

thanks for your work on this patch diomark. my ability to download podcasts, new apps & app updates stopped for reasons unknown on Dec 1. this patch and a reboot solved the problem!
rodhnc is offline   Reply With Quote
Old 12/06/2009, 10:28 AM   #17 (permalink)
Member
 
emeraldayotte's Avatar
 
Join Date: Jun 2009
Location: Nashville,TN
Posts: 177
Likes Received: 0
Thanks: 33
Thanked 15 Times in 13 Posts
Default

Well this patch doesn't appear to be working for me. I'm unable to install themes through PreWare because of the "Too many cards error".
__________________
"Music is well said to be the speech of angels." - Thomas Carlyle
emeraldayotte is offline   Reply With Quote
Old 12/21/2009, 10:18 PM   #18 (permalink)
Homebrew Developer
 
milominderbinder's Avatar
 
Join Date: Mar 2005
Location: ↑ iPhone Black Launcher Theme
Posts: 4,593
Likes Received: 117
Thanks: 2,535
Thanked 3,156 Times in 908 Posts
Default

Why did they decide to not put the webos 1.3.1 memory leak patch in Preware?

- Craig
__________________
- Milo
Getting StartedRingtonesVideos/MoviesPatches/ThemesMusic Player(Remix)
Battery LifeBackup/SyncingGreat Signal-AiraveiPhone ThemeForum Guidelines
milominderbinder is offline   Reply With Quote
Old 12/22/2009, 12:58 AM   #19 (permalink)
Member
 
Join Date: Sep 2009
Location: New England
Posts: 182
Likes Received: 0
Thanks: 51
Thanked 36 Times in 23 Posts
Default

I installed this patch, along with some other patches and fixes, and it appears to be working as diomark described it--works beautifully for me. See my post here for details: http://forums.precentral.net/showthr...=1#post2102450
intlbeans is offline   Reply With Quote
Old 12/25/2009, 02:10 AM   #20 (permalink)
Member
 
Join Date: Sep 2009
Location: London, UK
Posts: 1,609
Likes Received: 3
Thanks: 383
Thanked 891 Times in 345 Posts
Default

Mark, first of all I respect all the work you've done for the community, we need people like you to keep Palm on their toes and help the platform to progress.

I would like to point out that the only change this patch makes is to switch one function/value from false to true - it's clearly been disabled by Palm and we must assume that there's a good, proven reason why they did not activate what is ostensibly an advantageous function of the OS.

I love experimenting with patches and I actually intend to install this one when I'm done typing this, but I suppose I just wish we could somehow glean Palm's software engineers' reasoning for setting that particular value to false.
errade is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0