Friday, September 21, 2012

ASUS Com Service (atkexComSvc.exe) Memory Leak Work Around

The Problem
So I have noticed after leaving my fairly new PC on (only about 6-9 months old now) for about a week, I was losing a tremendous amount of memory and I couldn't account for where it was going. I currently have 8GB of RAM - which I will soon be upgrading to 24 GB purely for vanity reasons - and I noticed my system was using 6/8 GB of RAM! This is shocking because all I have been doing was development work, nothing major. So even after killing all of my development related programs (VS, SSMS, SQL Server, Millions of Chrome Windows, Snaggit etc...) I was still up to about 4-5GB which is incredibly unusual.

After some investigating in the task manager, I realized I wasn't showing all processes from all users. After ticking that box I found my culprit, a Com Service that talks to the BIOS, provided by ASUS for my ASUS P8Z68-V GEN3 Motherboard.

The Gotcha
There is a process named atkexComSvc.exe that has a very bad memory leak. The memory leak is so bad that after a week of my computer being on it racked up about 3GB of memory. That is horrific. Still not really knowing exactly what the problem is, I restarted my computer and problem solved. However restarting your computer isn't something you want to realistically do every day so I have a temporary work around for this minor annoyance.

Currently only using about 6.7 MB, wait about 20 minutes and it will be 12 MB...
The Solution
Well since this process is running and you know you didn't start it, that means it runs automatically at start up and since it ends in Svc, we can assume it is a Windows Service, of course not all windows services end in Svc... Anyhow, open up your Windows Services (Control Panel > System and Security > Administrative Tools > Services Shortcut) and search for what you see in the image below:

Highlighted in blue is the name of our Concern "ASUS Com Service"
If you are currently suffering from System Memory Loss from this service, go ahead and restart it. You can right click and select restart or use the menu on the left shown in the image above.

To verify that we have the right windows service (and process), right click on it and select "Properties".

Found the culprit process's Windows Service
So as you can see this service is automatically started and it spins up the process named "atkexComSvc.exe" as shown before in the Windows Task Manager. Well since all we can do right now to alleviate the memory leak is to restart the service, let's just do this every day automatically at about 5 AM. Sound good to you?

Notice the path to the service is conveniently shown, you can go there to do the next few steps.

Creating a Windows Task in Task Scheduler
So this is going to require a batch file, there are a number of ways of doing this, I just like using batch files for their simplicity.

Batch File Code
ECHO Stopping atkexComSvc.exe - ASUS Com Service
NET STOP "ASUS Com Service"
ECHO Starting atkexComSvc.exe - ASUS Com Service
NET START "ASUS Com Service"

Go ahead and throw that code into a file, name it whatever you want as long as the file extension ends in ".bat" so for example, I named my file "Restart Com Service.bat". You can double click on the file to execute it which is convenient at times for quick execution. The last line of the code is commented out by using the keyword REM. Only enable PAUSE (by removing the word REM) if you are debugging the script, otherwise your batch file's console window will show up at 5 AM and stay there until you press any key to make it go away.

I put this file into the same folder as the Com Service, not necessary, but I think it makes the most sense so you know where it is.

The location of the process (for me anyhow) is located here: C:\Program Files (x86)\ASUS\AXSP\1.00.14

Open up Task Scheduler (Control Panel > System and Security > Administrative Tools > Task Scheduler Shortcut) and you should see an ASUS folder. If you don't it doesn't matter, but just for organization I would add you task there. Right click on empty space and select Create Basic Task. Follow the prompts and when it asks you for the program/script, browse to the batch file we created earlier.

If you want to test your task after creating it, right click on it and select "run" from the context menu.

Don't worry if the service complains that it can't stop or anything - it might be in the middle of something OR if you already restarted it once and you are trying to restart it again, it might refuse you the second time. I encountered that problem. Either way the goal was to just make it empty out its memory allocations, so it could start filling up all over again.


PS: If ASUS doesn't fix this soon, I think I am going to decompile the service and look for the problem myself. This is just ridiculous. Hopefully they fix this soon.
UPDATE: 01/13/2013 - I couldn't decompile this executable. It is not written in .Net because when I used Just Decompile from Telerik it wouldn't work and I tried a C/C++ decompiler but it blew up when I tried to use it. So I guess I will just try the old fashioned way, I will make a support ticket for this when I get around to it. If anyone knows how to decompile this executable I'd appreciate a clue.