Jump to content

Skype memory reducer


lokster
 Share

Recommended Posts

Skype users may have noticed, that recent versions consume a lot of memory - 20 or even 30 megabytes.

This script reduces the memory used by skype, by continuously freeing the memory used by skype.exe and skypePM.exe.

Maybe in some cases this will cause some lag when using skype - eventually when talking with alot of people or makeing videocall.

I don't have webcam right now, so I can't test how skype behaves when making video call.

For now it works fine(~2 hours)

The script itself consumes about 700kb memory.

This may, or may not be usefull to you, but here it is:

skype-memory-reducer.au3

#include <Misc.au3>
_Singleton("skype-memory-reducer")

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

TrayCreateItem("Quit")
TrayItemSetOnEvent(-1, "Bye")
TraySetState()

Global Const $interval = 2000 ; interval at which the memory is freed, anything below this will almost certainly only slow down your system.

;here you can add any other process,
;but be carefull which process you choose,
;bacause in some cases this will slow down your application or even your PC
Global $list = "skype.exe|skypePM.exe"
Global $processlist = StringSplit($list, "|")

While 1
    For $i = 1 To UBound($processlist) - 1
        $pid = ProcessExists($processlist[$i])
        If $pid Then _ReduceMemory($pid)
    Next
    _ReduceMemory(); also reduce the memory used by the script itself...
    Sleep($interval)
WEnd

Func Bye()
    Exit
EndFunc   ;==>Bye

;I don't remember who was the author of this UDF... (it's not me)
Func _ReduceMemory($i_PID = -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   ;==>_ReduceMemory
Edited by lokster
Link to comment
Share on other sites

  • 4 years later...

These scripts don't actually reduce the memory used, it just pages the memory used by the process to the pagefile which will make your program run even slower. Don't bother with them.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

These scripts don't actually reduce the memory used, it just pages the memory used by the process to the pagefile which will make your program run even slower. Don't bother with them.

Thats right, but,

if you have limited ram, and just want skype to be running in the background why should it run fast? having the now free ram for your game and skype thankfully idleing in the pagefile, it will place itselve back into ram when needed or over time, depending on its recurring tasks it does while idleing.

Regards,

J.

$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")
For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)
Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI"
Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;
MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)
Link to comment
Share on other sites

hi everyone.

please explain me whatt i must add to this script for reducing skype memory if i have multiple acounts with skypelauncher.

in processeslist multiple skype proceses are shown with name skype.exe

what i must do to resolve this problem?

Link to comment
Share on other sites

Use ProcessList("Skype.exe") which returns an array, and then loop through the array to get all the PIDs for the running processes to send them one at a time to the ReduceMemory function.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

hi everyone.

please explain me whatt i must add to this script for reducing skype memory if i have multiple acounts with skypelauncher.

in processeslist multiple skype proceses are shown with name skype.exe

what i must do to resolve this problem?

I was also developing such script in past. But I couldn't find any solution for such problem. So if any one have new point to solve it please share here.

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...