AutoClosePatch 1.1 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

Comments
"Thank you" and such can go here.

For discussion and more elaborate comments, please post in the relevant threads on XDA-Developers or MoDaCo. If you don't have an account for either of these, you may post here directly, but I'd rather you didn't unless necessary or it's a "thank you" ;)

Note that I visit XDA-Developers a lot more often (say, 100 times a day) than MoDaCo (say, 0.2 times a day), so if it's urgent ...

XDA-Developers: http://forum.xda-developers.com/showthread.php?t=637771

MoDaCo: http://www.modaco.com/content/i8000-verizon-sch-i920-omnia-ii-http-i8000-modaco-com/295746/programs-auto-closing/
Note the thread on MoDaCo is not specifically about AutoClosePatch, but about the problem AutoClosePatch was written for to fix.

Comments

Posted by gavin on 24-02-2010 at 09:46:38
ohh!!great!
Posted by kydkylin on 24-02-2010 at 10:18:08
thank you so much!!!
Posted by ocean on 24-02-2010 at 13:43:44
nice work
Posted by Tay Hee Seng/skoda60 on 24-02-2010 at 14:30:59
Thank It make my Omnia2 as a windows mobile device. Already done a donation.
Your hard works and knowledge were deeply appreciated.
I enjoy the Omnia2 now with your patch.
Posted by jojo on 25-02-2010 at 02:05:50
Thank You Very much
Posted by GuiHuo on 25-02-2010 at 02:26:28
Thank You Very much

@Foshan GuangDong China
Posted by Godman Ng on 25-02-2010 at 12:54:55
It works!
thx very much!
Posted by NoNam3 on 25-02-2010 at 21:04:35
After installing this patch on OMNIA 2, you need to keep it in order to run , or can just be uninstalled from programs and it will still run ?
Posted by Chainfire on 26-02-2010 at 00:11:31
If you uninstall the patch it'll stop working...
Posted by Dan on 27-02-2010 at 00:12:23
thank you very much very much
Posted by Nazar78 on 01-03-2010 at 10:31:44
Is it normal in your app that there's no exe running in background? It just startup AutoClosePatch.exe link from start folder, sets the necessary and terminates?
Posted by Chainfire on 01-03-2010 at 19:34:22
Correct. The EXE is only a loader, the AutoClosePatch.dll does all the work in remains in memory.

The EXE just injects the DLL into the kernel, then exits.
Posted by lastnikita on 04-03-2010 at 16:49:32
You're the dude, dude.
Congrats... Again !!
Keep the goodies comin' ;)
Posted by marc on 08-03-2010 at 14:37:18
after installing AutoClosePatch v1.1 is there a need to edit the registry?
Posted by Chainfire on 08-03-2010 at 17:06:55
Nope.
Posted by moxadrian on 09-03-2010 at 16:52:17
thank you so much .I'll test it righnow.Is it possible to have only 128 ram memory and the reserved ram to be just a lie?Maybe stupid question:)
Posted by Chainfire on 09-03-2010 at 17:39:14
There probably really is 256mb of RAM in the device... who knows what it is reserved for. Could well be radio comm or shared GPU memory or the likes. I don't know, I haven't investigated it properly.
Posted by qiaoyang1st on 12-03-2010 at 03:52:24
thanks a lotï¼ï¼ï¼
Posted by Vinícius on 13-06-2010 at 23:15:00
Hi there!

After installing ultra variant, do I have to manually set 10/15 or it should be automatticaly configured by the cab file?

Here I did the values changes manually!

And does this patch support portuguese language devices?



Thanks from Brazil!
Posted by Julian on 17-06-2010 at 17:46:58
Just installed AutoClosePatch 1.1 on my HTC HD2 and it is working great currently. I will test it for another couple of days and if successful I will make a donation. Thank you for a wonderful patch which can be a life saver for WinMo 6.1 and above devices.
Posted by 天ä¸ææ on 23-06-2010 at 04:59:31
ææ¿,谢谢你!
Posted by j4n on 11-07-2010 at 18:21:22
Great work chain. Works fine on my HD2.
Donation: http://forum.xda-developers.com/showpost.php?p=7143129&postcount=13
Posted by Thomas on 28-07-2010 at 09:04:06
Thanks for this, works pretty well on my HTC Diamond 2.
I have a small question though. The other day, I was browsing the Windows Marketplace and noticed an app called Morose Multitask++. This claims to do exactly the same as your Autoclose patch. So well, is this the same thing ?

Thanks fot your answer

Thomas
Posted by Chainfire on 03-08-2010 at 13:20:10
Yes it is :)
Posted by dani on 17-08-2010 at 11:01:39
hi chain, is there any trial for Multitask++ on the marketplace?? i want to try it on my omniaII, please send me the trial if you have to dani.sharmanta@gmail.com
thanks
Posted by Tac on 28-01-2011 at 06:11:56
Chainfire, sick patch. one of the best downloads for omnia 2. I notice my applications memory drop already- no more silly closing. thank you so much
Posted by Roger on 08-02-2011 at 12:24:51
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!
Posted by joseph on 24-04-2011 at 23:31:15
hi chainfire your app is so good. it really maximes multitasking ability of wm 6.5 devices. :) what i am really confused of for now is about the two installation autoclose patch programs. why the "no ultra" version has a bigger filesize than the "ultra" version?

also is it ok to only install the 1kb ultra version without installing the 169kb no ultra setting version.

hope you can feedback me on this. thanks much :)
Posted by Chainfire on 26-04-2011 at 14:36:12
No, if you want ultra you need to install both! The ultra package only installs a SETTING, not the actual code.




(This is a trap for bad people - don't input website)




You may use tags like [b], [u], [i], [url], [quote], [code], [pre], etc