Use Empty.exe to reduce autohotkey-occupied memory

Source: Internet
Author: User

Reprinted from: http://hi.baidu.com/jdchenjian/blog/item/6acec502c8bbab703912bbf9.html

AutoHotkey is powerful and simple to use, with a slightly larger memory footprint (about 4M) compared to other similar software (such as Hoekey). But if your AutoHotkey (or the compiled. exe program) resides in memory, most of the time just waiting for the hotkey in the background or waiting for other tasks, there is a way to reduce its memory footprint. I tried Empty.exe this gadget and it worked very well.
Empty.exe is a command-line gadget from Microsoft (program size 9.5k only) that can be used to release memory that is consumed by the specified application.
Its application format is: Empty.exe process pid or Empty.exe process name

Click here to download Empty.exe

You can place the Empty.exe in the script directory or in the system Temp folder, adding the following line of code when the script is transferred from the foreground to the background, or when a hotkey response is completed:

Runwait, Empty.exe autohotkey.exe,,hide

If the script is compiled into an EXE file, it is changed to the following line:

Runwait, Empty.exe%a_scriptname%,,hide

It does this by calling Empty.exe to free its own free memory after AutoHotkey (or EXE) completes a task. This can greatly reduce the memory footprint of AutoHotkey (or the compiled. exe program). Here is a comparison of autohotkey memory consumption before and after adding this line of code:

Before using Empty.exe:

After using Empty.exe:


From the above comparison, AutoHotkey occupied memory from 4M to about 500k, and does not increase the use of virtual memory (both front and back are 1460k). Empty.exe can be seen instead of transferring memory to virtual memory as part of a memory-finishing software, which actually lowers the memory that the application consumes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.