Jump to content

Recommended Posts

Posted

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

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted (edited)

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()
Posted (edited)

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]
Posted

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]
Posted (edited)

I found a minor mistake. You messed up the percentage readout for the RAM.

NM wasent a mistake.

Nice work.

EDIT:percentag, yea... I can spell I swear..

Edited by smstroble

MUHAHAHAHAHA

Posted

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

Posted

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

Posted

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]
Posted (edited)

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]
Posted (edited)

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]
Posted

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]
Posted (edited)

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]

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
  • Recently Browsing   0 members

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