[24.02.2010] AutoClosePatch 1.1

Search This thread

Chainfire

Moderator Emeritus / Senior Recognized Developer
Oct 2, 2007
11,443
87,755
www.chainfire.eu
As posted on my blog: http://www.chainfire.eu/articles/68/AutoClosePatch_1_0_released/

Updated to 1.1 on 24 February 2010

AutoClosePatch
Some devices, especially the new 2009 Omnia series from Samsung do not have a lot of memory available. Some of these are also configured to use rather aggressive memory management. The result is that you can hardly start any amount of applications (3 or 4, usually) before the system starts to shut down already running applications, while half or more of the available physical memory is not being used at all.

What AutoClosePatch attempts to do is hook into these memory management functions and beat them into submission, preventing them from doing anything we have not explicitly told them to do.

Of course, we do have to have automatic application closing functionality so our devices do not get stuck in a low memory position, so occasionally we let the system do what it wants within specified parameters.

Note that this patch was specifically written and only tested on the Omnia II (I8000), but it should work on many WM 6.5 devices. This patch does not need any of the other changes mentioned in various MoDaCo threads and is compatible with TaskMon!

Also note that the system is not always very smart, and in my experience tends to close the last application I openened instead of the first.

Beta
Consider this a beta version (even though it is a 1.0 release). Several factors come into play and operation cannot be guaranteed. Works great for me, though!

I take no responsibility for issues that may occur, at all. If your dog explodes due to using AutoClosePatch, tough luck.

Settings
By default, my Omnia II starts closing apps when available memory drops below about 30mb, and doesn't stop closing apps until available memory has risen above about 45mb. As I start out with about 50mb of available memory this isn't very handy.

AutoClosePatch's default settings are to not start closing apps until available memory drops below 15mb, and to stop closing apps when available memory has risen to above 20mb.

The "Ultra" variant lowers this to 10/15, but has more chance of showing you an 'out-of-memory' dialog.

Installation
Install the AutoClosePatch CAB. If you want to play with the "Ultra" variant, install the normal version first!

Soft-reset after installation

Uninstallation
Simply uninstall the CAB files if you are not using the "Ultra" variant. Uninstalling will clear most settings but not some system settings. These changes aren't harmful, but you'll need to hard-reset to clear them up.

Soft-reset after uninstallation

Technical
Skip this part if you're not a techy ;)

The whole thing is done through run-time patching, this means no files are modified on the device itself, only in-memory.

Some system calls are overridden / intercepted in shell32.exe, and depending on actual memory state WM_CLOSE may be re-cast as WM_HIBERNATE.

For the new 2009 Omnia series from Samsung TaskMon.dll is also patched, disabling it's application closing functionality. All other TaskMon functions should remain fully operational. In essence, only the standard WM application closing functionality should remain functional.

The low memory boundary (when apps start being closed) can be configured through the following registry key:

HKEY_CURRENT_USER\Software\Chainfire\AutoClosePatch\CloseStartMB

The high memory boundary (when apps stop being closed) can be configured through the following reigstry key:

HKEY_CURRENT_USER\Software\Chainfire\AutoClosePatch\CloseStopMB

You must soft-reset after changing these keys for them to take effect.

Also note that if you are going below the default 15/20 value you must install the "Ultra" settings first.

Furthermore, if you are playing with very low settings (and are thus using the "Ultra" settings) make sure to NOT set the CloseStopMB value above 20!

Downloads
REDISTRIBUTION AND COOKING INTO ROMS IS EXPLICITLY FORBIDDEN (for the time being)

AutoClosePatch v1.1

AutoClosePatch v1.1 Ultra (Settings only)

Donate
Donations can be made through PayPal

Changelog
1.1 Adjusted closing behavior so it closes less programs
1.1 Slightly adjusted default settings

1.0 Initial release
 
Last edited:

holyseal

New member
Mar 3, 2009
4
1
looks pretty cool :)
my omnia should arrive sometime next week, will definitely use this.
thanks !
 

fire_z

Senior Member
Jul 2, 2007
139
5
Manila
Works with Omnia B7610 but with a bug

When memory reaches 24mb down (in my case 24-18mb) you cannot open anymore applications/programs,and those that were opened (16 apps opened with 24mb left) even the task manager cannot be opened, so soft reset is needed to close all... Though system apps (those in the settings) still open and run.
 

jakaka

Senior Member
Apr 16, 2008
66
11
Thank you my good man :) 08C54399RW746270M Here you have little something for beer
 
Last edited:

Chainfire

Moderator Emeritus / Senior Recognized Developer
Oct 2, 2007
11,443
87,755
www.chainfire.eu
Works with Omnia B7610 but with a bug

When memory reaches 24mb down (in my case 24-18mb) you cannot open anymore applications/programs,and those that were opened (16 apps opened with 24mb left) even the task manager cannot be opened, so soft reset is needed to close all... Though system apps (those in the settings) still open and run.

Did this happen with 1.0 or 1.1 ?

Please try agian with 1.1 and make sure to soft-reset after installation !
 

sudkcoce

Senior Member
Sep 25, 2009
789
212
Thank you!

Works great on my omnia i900!
Just what I needed!

Best regards!
 

Stephane Dufault

Senior Member
Jan 13, 2009
52
2
Montreal
Not working?

Hi,

This is exactly what I am looking for, but it does not seem to work on my devise TP2, the programs still close randomly...

I try to run the regular and ultra manually, I do not see any loaded progam (I guess that is normal since it leaves only the dll), but I do not see any entries/changes in the Registry?

Please help to make this work or propose another solution.

THanks,
 

whyhon

Member
Jun 14, 2006
22
0
This is good.. i thought closing down apps is a problem of Omnia pro only...
With this patch, my Omnia is very powerful again as my previous Touch Pro..
Thanks a lot..
 

Nosfi

Member
Sep 6, 2007
15
0
Thanks for your great work. But i have a doubt:
Is there a way to exclude only one App from being closed?

I really like the autoclose function, it keeps my mobile working correctly all the day, but I'm working with my mobile ERP all the day long and i don't want anyone to close it...

thanks!
 

jukefox

Member
Aug 25, 2009
38
0

PoleK

New member
Dec 17, 2009
3
1
This sounds great, but,does not work on my Omnia Pro B7610...

It installs correctly, but i get something like that after soft reset:

An unhandled exception occured at $000115E0 : EAccessViolation : Acces Violation
$000115E0
$00011818

i wish U could tell me what's wrong... i am using FluidX ROM based on 6.5.3 i guess...