Possible memory leak in web shield

I am posting here because I believe that I am seeing what appears to be a memory leak of some kind in Avast’s web shield (latest released version of 4.6).

At first I thought it was my firewall but have since ruled that out and believe it is Avast.

I installed Avast with all the default settings intact, then proceeded to browse in IE for an hour or so. I noticed that my free ram decreases, by about 20 mb after one hour of browsing. I have checked in task manager and Process Explorer and ram usage by web shield appears to stay around 2-6 mb, which seems fine. No problems there. However, I think Avast is somehow eating ram since my free ram continues to decrease slowly as I browse. After 2 hours it’s down by almost 35 or 40 mb.

I then removed Avast and tested again by browsing intensely for an hour or two, and there is NO decrease in free ram. Installed Avast again, and the ram eating behavior re-appears once more.

I have seen this situation once before with a beta version of Jetico firewall. I reported it and they checked their recent code and fixed the problem. After that, the ram eating stopped and all was well. So this appears to be a similar situation with Avast.

I will continue to observe here without Avast installed, just to make sure there is no further ram eating behavior, but I believe that it is Avast causing the problem. Hopefully this can be researched and tested and resolved, as Avast is an excellent product and my favorite AV which I have used for nearly a year.

PS - This is the free Avast Home version I am talking about. I believe it is 4.6.652 released last week.

What operating system do you use?
How did you check the “free memory” size?
Can you inspect the virtual memory size of avast! processes (called ashSomething or aswSomething) and check if it increases, as the “free memory” decreases?

I am using Win2k sp4 with all updates installed and current.

For free memory, I use a small utility called TClockEx which, amoung other things, let’s you display free ram in the system tray at all times, so I watched it from there. Free ram is also available via task manager.

How do I check the virtual memory size that a process is using? That’s an interesting point.

Found I can check virtual memory usage via Process Explorer. I will reinstall Avast and keep an eye on that and report back.

What would that prove though, if virtual ram for Avast processes increased as free ram decreased? That Avast is just using more ram virtually and taking it away from the pool? And will it ever free this virtual ram and return it to the free ram pool?

Task Manager (ctrl+alt+del) > Menu View > Select colums > Virtual Memory
Virtual RAM is more precise and ‘means’ what is actually being used by the program.

Thanks Technical…

Ok, tested a little bit and here’s what’s happening so far…

Initially here is the memory usage of each process:

Process Normal Mem Virtual Mem
aswUpdSv 176K 14,480K
ashServ 5780K 177,308K
ashWebSv 9364K 55,536K
ashMaiSv 1868K 55,900K
ashDisp 6428K 46,688K

I then browsed in IE for about 15 minutes and checked usage again. Everything stayed the same, except for one. ashWebSv. Free (available) ram went down 10 mb and virtual memory usage went up 10 mb for ashWebSv (web shield):

ashWebSv 11,780K 65,776K

Then I browsed for another 15 minutes or so, and checked again. THIS time, free (available) ram went down another 10 mb, however, the Avast processes stayed the same, no additional usage!

So I assume that there is another process that’s using the ram now? What does this mean? Can it be an Avast leak?

Also, if there is a process who’s virtual memory usage increases, what relationship to free (available) ram does this have? I thought virtual ram was your HD only. How is free ram affected?

I’m a little confused now.

I will continue to browse tonight and see how low I can get free (available) ram to go. Will also look and see if I can determine which processes are using more virtual ram as this happens…

Any explanations or elaboration on this is appreciated though!

Just a quick follow-up here. I did some more experimenting, and I think I have things figured out here.

Avast does not appear to have a problem after all. Which pleases me no end because now I can use it. It’s always been my first choice.

I believe what I’m seeing is just my browser(s) using up more ram (both regular and virtual) as I browse. I tried using Opera for a while as well as IE, and both used a growing amount of virtual memory over time. But when I exit Opera for example, it frees up all the memory it used and I’m ok. When I exit IE however, it doesn’t free it up completely, so perhaps this is just due to IE’s close integration with the OS or something? Not sure.

But watching virtual memory usage, Avast appear to be fine after all.

Thanks to Technical and Igor for your help. The virtual memory checking was an excellent idea that I hadn’t thought of.

Well, I’m stumped still at why I don’t see the ram consumption when I remove Avast… still a mystery after all.

Let me ask this one question:

Is it possible for a program to have a memory leak and eat ram even though the ram usage doesn’t show up in normal OR virtual memory usage?

Keep an eye on the Kernel Memory section of the Performance tab as well. Are the numbers growing?

Also, the numbers you quoted previously for VM Size of ashServ.exe ashWebSv.exe look huge. Such numbers may be normal only when avast is in the process of scanning a big file. Are you downloading any files in the background? Or maybe using a P2P app to download something?

Thanks
Vlk

Hi Vlk -

Yes, I thought the numbers looked huge also! I found it hard to believe the main service was using 177 mb of virtual memory.

No P2P or downloading were going on here at all. In fact, those numbers were just after a reboot and all I did was load Outlook, IE, and Gravity (newsreader). The machine was basically idling at that point when I first measured usage.

Something strange is going on. I have a freshly formatted new install of Win2k with all the updates, so there shouldn’t be anything odd running or going on here at all.

Just to note the memory usage difference between say AntiVir here and Avast that I saw earlier, AntiVir is using 36 mb virtual, compared to that 177 mb.

I will try to observe it more. Right now I am just running AntiVir and then browsing normally with IE. I’ll do that for a day, just to make sure ram is NOT decreasing due to some other source. If I see no problems, then I’ll reload Avast and watch it some more…

After clean boot you’re saying… normal number I’d expect is somewhere between 10-20MB, maybe 25, but definitely not over 100 :slight_smile:
There’s something fishy there. Once you install avast back, we can do some more tests and find out what the problem is.

BTW I’m just sitting in the San Francisco airport terminal - and the plane is late AGAIN! :-\ :-\ :cry:

Cheers :slight_smile:
Vlk

Vlk - I browsed and used the system for about 6 hours with AntiVir and I show no free memory loss. So I just reloaded Avast here for some more testing.

I got curious about the huge numbers for virtual memory that Process Explorer reported, so I took a look at what Windows Task Manager reported and behold! The numbers are normal. So it’s Process Explorer just reporting bogus numbers. Sorry about that! I should have used Task Manager to begin with I guess.

Here is what I show after a fresh install of Avast and a clean reboot:

process normal mem virtual mem
aswUpdSv 172K 392K
ashServ 6140K 14448K
ashWebSv 2756K 4280K
ashMaiSv 1088K 2640K
ashDisp 1392K 1448K

Looks a lot more normal now. :slight_smile:

I don’t know if I can do it now, but I will browse for a while and then record the numbers again and see if they have changed at all.

Ok, I have had some time to browse for an hour or two and I think I can wrap this up now. My ram has decreased by 20 megs, however, I can account for it all by increases in usage by Avast processes, mostly web shield AND also increases in ram usage by the system Kernel. Thanks Vlk for mentioning that. I didn’t know to look there either. I am assuming that this kernel ram usage is not a problem of any kind, but just normal system usage. It started at about 51 mb and rose up to 62 mb after an hour or two. Doesn’t seem to be too much there. Web shield also rose by about 10 mb between virtual and normal ram use. Not really anything to worry about either (I assume).

So unless anything here seems like a problem, I will have to conclude that there really is no problem with Avast and that the ram usage can indeed be explained…

Thanks for the suggestions to all…