Jump to content

MemStats


AutoItKing
 Share

Recommended Posts

This is a pretty cool program. will definitely prove to be useful!

btw, what IS page file usage?

The pageing file is as AutoitKing says, a file on your hardrive that your computer uses as a replacement for RAM, your computer will usually try to keep it 50% RAM and 50% pagingfile. unless you dont have enough RAM. Also if you turn on hidden files, see folder options in control panel, it is a file named "pagefile.sys" in the root directory of the hardrive the paging file is on, ex: C:\pagefile.sys

MUHAHAHAHAHA

Link to comment
Share on other sites

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Does anyone know of any RAM optimizing dll's I could use? I have googled it.

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Does anyone know of any RAM optimizing dll's I could use? I have googled it.

u dont need any dll, psapi.dll (which is a dll in windows, and included with autoit) should work..

;Author - wouter
Func _ReduceMemory($i_PID = -1) 
    $memory_counter = 1
    If $i_PID <> - 1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf
    Return $ai_Return[0]
EndFunc
Edited by mrRevoked
Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

Ok, here's what I got so far:

$processes=ProcessList()
ProgressOn("Optimizing Memory","Please Wait")
$i=0
$i2=0
$percent=0
$num=1
While $i<=$processes[0][0]
    _ReduceMemory($processes[$num][1])
    $i +=1
    $num += 1
    $i2 += 1
    If $i2=Round($processes[0][0]/100,0) Then 
        $percent += 1
        ProgressSet($percent,$percent & "% Done")
        $12=0
    EndIf
WEnd
ProgressOff()


Func _ReduceMemory($i_PID = -1) 
    $memory_counter = 1
    If $i_PID <> - 1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf
    Return $ai_Return[0]
EndFunc

But it gives me errors:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\Ben\Desktop\MemStats GUI.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams    
+> Starting AutoIt3Wrapper v.1.7.3
>Running:(3.2.1.14):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Documents and Settings\Ben\Desktop\MemStats GUI.au3"  
C:\Documents and Settings\Ben\Desktop\MemStats GUI.au3 (8) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: 
_ReduceMemory($processes[$num][1]) 
_ReduceMemory(^ ERROR
+>AutoIT3.exe ended.rc:0
>Exit code: 0   Time: 1.944
Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Screw it, I'll just stick with putting _ReduceMemory in there. And not go through every process. But I might later on. Any one know how to fix that :whistle: code?

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

HA! I got it! It will go through every process and empty the working set of that process. See first post.

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

No, that's right.

From the help file:

$array[0] = Memory Load (Percentage of memory in use)

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Your right it does work. Stange must be some kind of glitch in auto it or something. It wasent updateing the percentage readout but it was updating the most used and least used records, which is why i made the change. Oh well, nevermind then lol.

MUHAHAHAHAHA

Link to comment
Share on other sites

(see first post)

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

(see first post)

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

you're assuming that the script name is memstats_web.au3...

notice that if you have the latest version of Web.au3 (which i strongly recommend), you'll see that:

$_SCRIPT_NAME: the current name of the script. For example, for www.test.com/folder/script.au3 (not a real script), it would return "/folder/script.au3"

although since you don't want the "/folder/" part, you might want to strip that off with some quick string functions...

$script = StringRight ($_SCRIPT_NAME, StringLen($_SCRIPT_NAME)-StringInStr($_SCRIPT_NAME, "/", 0, -1))

should do it.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

That about does it!

I'm also working on a log in system, to add some level of security. But I don't think it will be very strong though.

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

I got it!!

Password protection (very weak).

Download in first post!

And I do have the latest version, I believe.

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

I made some more changes.

Oh, and *BUMP*

I will very likely make this nice looking, just not today. It'll take time. But I have a lot of that on my hands.

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Almost forgot to say,

I added the Defrag RAM function from mrbond007.

Just letting you know!

I guess some people might call this a bump. So to make them happy . . . ~{BUMP}~

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

I made it look kind of nice. A nice dark color, instead of that deadly white, and a nice border. See the first post.

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

I have outdone my self now!! I added some progress bars to the whole shebang. You will need to download a zip now since there are a few files. And it will be compiled from now on. But if you ask I will give you the source. Thanks!

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...