Cleanmem - The First Memory Cleaning Dll (update!), From 500,000kb down to 2,000kb! |
![]() ![]() |
Cleanmem - The First Memory Cleaning Dll (update!), From 500,000kb down to 2,000kb! |
Jun 30 2009, 07:14 PM
Post
#1
|
|
|
Programmer Group: GMC Member Posts: 543 Joined: 29-December 06 From: Ontario, Canada Member No.: 67113 |
CleanMemV2.0 By Halo Shg ![]() Information: If you've ever found your game lagging or consuming too much memory, you're in the right place. Finally, a perfect solution to bring down the memory consumption! Functions:
Special Notes: You should probably call this on room change and game end. More won't do any harm, but it wouldn't really be necessary. This DLL is only 4.5kb in size. UPDATE: Now you can get the amount of memory your game is using! That means you can clean when it gets above a certain point! - Thanks GMLismybeach for the suggestion Legal Information And Licensing Ok, so a lot of people have been asking me about this (both here and in PM's). I figured I'd better put up some info. QUOTE You MAY use this in a freeware application freely. You MAY use this in a shareware application freely. You MAY use this in a commercial application freely as long as I am credited somewhere in the application. You MAY NOT modify the executable WITHOUT crediting me for the original. You MAY request the source. For any uses other than commercial (ie. shareware, freeware) crediting is optional. For commercial games, credit is required. If you would like a version with no information (this is, my name is not stamped on the DLL), you may request it. Keep in mind, however, that credit is required for ALL types of applications if you are using this version. If have any special requests, PM Me. Examples: You have a freeware application and the DLL is the original (unmodified) copy.
You have a freeware application and you have modified or requested the NoInfo version of the DLL.
You have a commercial application (regardless of the DLL type)
You have requested/disassembled the source, and are distributing a modified version either in your application or standalone.
Download: Direct Link (Right Click > Save As) Old V1 Mirror 1 Mirror 2 This post has been edited by halo shg: Nov 3 2009, 11:41 PM |
|
|
|
Jun 30 2009, 07:49 PM
Post
#2
|
|
|
Indie Game Developer Group: GMC Member Posts: 1628 Joined: 1-April 04 From: Athens, Greece Member No.: 7742 |
Nice work!
As I have already made something similar for my games I'd say it would be safe to free the memory every 50 steps (don't use it in a Step event, leave some interval between). Just DON'T free the memory when you're e.g. creating, replacing a sprite, background, sound or freeing them. (Should make sense) I wonder why Game Maker doesn't have an inbuilt function for this? This post has been edited by Sindarin: Jun 30 2009, 07:50 PM |
|
|
|
Jun 30 2009, 08:13 PM
Post
#3
|
|
|
GMC Member Group: GMC Member Posts: 3835 Joined: 9-December 07 Member No.: 94888 |
Well, I did give it a try, and watched the memory usage in Process Explorer. It didn't work.
Maybe it's the example? Windows XP SP3, Intel P4 1.7GHz (32 bit) |
|
|
|
Jun 30 2009, 08:27 PM
Post
#4
|
|
|
wademcgillis.com Group: GMC Member Posts: 967 Joined: 25-December 04 From: GMT-5 Member No.: 18655 |
|
|
|
|
Jun 30 2009, 08:49 PM
Post
#5
|
|
|
GMC Member Group: GMC Member Posts: 1021 Joined: 2-March 04 From: ./UK/England/ Member No.: 6620 |
BUG: You don't close your process handle after you open it.
|
|
|
|
Jun 30 2009, 08:57 PM
Post
#6
|
|
|
Programmer Group: GMC Member Posts: 543 Joined: 29-December 06 From: Ontario, Canada Member No.: 67113 |
That's strange. I had no problems testing it on multiple computers running multiple operating systems.
EDIT: QUOTE BUG: You don't close your process handle after you open it. Fixed. Redownload. This post has been edited by halo shg: Jul 1 2009, 03:24 PM |
|
|
|
Jun 30 2009, 09:14 PM
Post
#7
|
|
|
GMC Member Group: GMC Member Posts: 3835 Joined: 9-December 07 Member No.: 94888 |
Debug version returned zero, and still didn't clear any memory.
CM.exe is complete rubbish, it seems to be corrupt, and I can't delete it...thanks for the Trojan, removed. This post has been edited by GMREC1111: Jun 30 2009, 09:15 PM |
|
|
|
Jun 30 2009, 09:28 PM
Post
#8
|
|
|
Programmer Group: GMC Member Posts: 543 Joined: 29-December 06 From: Ontario, Canada Member No.: 67113 |
EDIT:
Post removed. You can still get PcWinTech's memory cleaning tool from PcWinTech.com This post has been edited by halo shg: Nov 10 2009, 09:31 PM |
|
|
|
Jun 30 2009, 09:35 PM
Post
#9
|
|
|
GMC Member Group: GMC Member Posts: 3835 Joined: 9-December 07 Member No.: 94888 |
It is still failing, no changes are detected in Process Explorer (excluding the stopping of allocating memory). Basically it doesn't show a decline, but it did in fact update.
|
|
|
|
Jul 1 2009, 07:31 AM
Post
#10
|
|
|
GMC Member Group: GMC Member Posts: 1196 Joined: 30-November 03 Member No.: 2861 |
It works perfectly for me (win xp 32bit sp3). It increases the load when run and when I press space the mem usage drops down to about 2,000K (from 35,000 or even 50,000). So it works nicely.
|
|
|
|
Jul 1 2009, 08:40 AM
Post
#11
|
|
|
GMC Member Group: GMC Member Posts: 100 Joined: 27-September 08 From: Australia GMT+9:30 Member No.: 115517 |
I haven't yet tried it but is very interesting. This would be a tool for anyone with a game that drains tons of memory.
Downloading now! |
|
|
|
Jul 1 2009, 03:42 PM
Post
#12
|
|
|
Programmer Group: GMC Member Posts: 543 Joined: 29-December 06 From: Ontario, Canada Member No.: 67113 |
@Sindarin - I too wonder why it isn't built in. It was only like 5 lines of code.
@GMREC1111 - I think I may have found the problem. You said you were using Process Explorer, so I assume you were looking at Virtual Size, instead of Working Set. Basically, your looking at the amount allocated memory, not memory usage. You can toggle that column, or use Windows XP's task manager by typing taskmgr.exe into the run dialog @HaRRiKiRi - Thank you for confirming that it works on SP3. Thanks for testing it aswell. @smart_monkey - I'd be happy to hear your response ~ Halo Shg |
|
|
|
Jul 1 2009, 04:33 PM
Post
#13
|
|
|
GMC Member Group: GMC Member Posts: 3835 Joined: 9-December 07 Member No.: 94888 |
@GMREC1111 - I think I may have found the problem. You said you were using Process Explorer, so I assume you were looking at Virtual Size, instead of Working Set. Basically, your looking at the amount allocated memory, not memory usage. Okay, I guess it works. But it's not freeing allocated memory. If I read correctly. |
|
|
|
Jul 1 2009, 07:23 PM
Post
#14
|
|
|
GMC Member Group: GMC Member Posts: 996 Joined: 21-March 09 Member No.: 130325 |
This really helps with my 3D game. (With this, it actually goes above 10 fps on my crappy computer)!
|
|
|
|
Jul 1 2009, 09:12 PM
Post
#15
|
|
|
GMC Member Group: GMC Member Posts: 248 Joined: 9-November 03 From: New Hampshire Member No.: 1849 |
Just tried it on Vista 64 bit, and seems to work fine. As useful as this does seem, would you mind adding a description of how exactly this works and what it is that it is doing to free the memory?
|
|
|
|
Jul 1 2009, 09:37 PM
Post
#16
|
|
|
Covac Software Group: GMC Member Posts: 2715 Joined: 3-July 06 From: Gozo, Malta, Europe Member No.: 53953 |
Actually it may be the second such dll
|
|
|
|
Jul 1 2009, 09:53 PM
Post
#17
|
|
|
Rocker Group: GMC Member Posts: 3933 Joined: 12-March 04 From: USA Member No.: 6970 |
Very nice. At first I thought it would mess with loaded resources or some such nonsense, but I underestimated you. A quick test (saving the created sprites to a ds_list and drawing them all every step) shows the resources are fine and the memory still drops incredibly!
Very nice. I need to go check out how much memory Blastix is using (never did, ironically), and if it's a large amount, I'll definitely use this DLL. -IMP *EDIT* Well, the test was a success. Blastix was hogging almost 100,000 KB of RAM, then I used your DLL and called it every time the room changes, and it knocked down to only 7KB. Amazing. I'll be using this. This post has been edited by IceMetalPunk: Jul 1 2009, 10:00 PM |
|
|
|
Jul 2 2009, 01:54 AM
Post
#18
|
|
|
Programmer Group: GMC Member Posts: 543 Joined: 29-December 06 From: Ontario, Canada Member No.: 67113 |
@GMREC1111 - I'm not sure if this is possible. Even all the commercial memory cleaners I've tried fail to do this. Makes me think it isn't possible.
@prog - Glad you liked it. @Meiun - Of course. Using an API call, I am able to remove pages from the working set (Google it). First, however, I must register this DLL as a "debugger" to avoid denial of access. If you want the (C++) source, PM me. I would be happy to give it to you. I'm not sure if I'd like to release it to public yet though. @uuf6429 - Well, OK. Mines publicly available @IceMetalPunk - On a final note, happy Canada Day to all! And in case I forget, happy early Independence Day! ~ Halo Shg |
|
|
|
Jul 2 2009, 02:28 AM
Post
#19
|
|
|
GMC Member Group: GMC Member Posts: 1311 Joined: 17-August 04 From: New Zealand Member No.: 13059 |
Wow worked great.
|
|
|
|
Jul 2 2009, 02:32 AM
Post
#20
|
|
|
GMC Member Group: GMC Member Posts: 996 Joined: 21-March 09 Member No.: 130325 |
What exactly does this do?
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 9th February 2010 - 05:20 PM |