Январь 2010 Февраль 2010 Март 2010 Апрель 2010 Май 2010
Июнь 2010
Июль 2010 Август 2010
Сентябрь 2010
Октябрь 2010
Ноябрь 2010
Декабрь 2010
Январь 2011
Февраль 2011 Март 2011 Апрель 2011 Май 2011 Июнь 2011 Июль 2011 Август 2011
Сентябрь 2011
Октябрь 2011 Ноябрь 2011 Декабрь 2011 Январь 2012 Февраль 2012 Март 2012 Апрель 2012 Май 2012 Июнь 2012 Июль 2012 Август 2012 Сентябрь 2012 Октябрь 2012 Ноябрь 2012 Декабрь 2012 Январь 2013 Февраль 2013 Март 2013 Апрель 2013 Май 2013 Июнь 2013 Июль 2013 Август 2013 Сентябрь 2013 Октябрь 2013 Ноябрь 2013 Декабрь 2013 Январь 2014 Февраль 2014
Март 2014
Апрель 2014 Май 2014 Июнь 2014 Июль 2014 Август 2014 Сентябрь 2014 Октябрь 2014 Ноябрь 2014 Декабрь 2014 Январь 2015 Февраль 2015 Март 2015 Апрель 2015 Май 2015 Июнь 2015 Июль 2015 Август 2015 Сентябрь 2015 Октябрь 2015 Ноябрь 2015 Декабрь 2015 Январь 2016 Февраль 2016 Март 2016 Апрель 2016 Май 2016 Июнь 2016 Июль 2016 Август 2016 Сентябрь 2016 Октябрь 2016 Ноябрь 2016 Декабрь 2016 Январь 2017 Февраль 2017 Март 2017 Апрель 2017 Май 2017
Июнь 2017
Июль 2017
Август 2017 Сентябрь 2017 Октябрь 2017 Ноябрь 2017 Декабрь 2017 Январь 2018 Февраль 2018 Март 2018 Апрель 2018 Май 2018 Июнь 2018 Июль 2018 Август 2018 Сентябрь 2018 Октябрь 2018 Ноябрь 2018 Декабрь 2018 Январь 2019
Февраль 2019
Март 2019 Апрель 2019 Май 2019 Июнь 2019 Июль 2019 Август 2019 Сентябрь 2019 Октябрь 2019 Ноябрь 2019 Декабрь 2019 Январь 2020
Февраль 2020
Март 2020 Апрель 2020 Май 2020 Июнь 2020 Июль 2020 Август 2020 Сентябрь 2020 Октябрь 2020 Ноябрь 2020 Декабрь 2020 Январь 2021 Февраль 2021 Март 2021 Апрель 2021 Май 2021 Июнь 2021 Июль 2021 Август 2021 Сентябрь 2021 Октябрь 2021 Ноябрь 2021 Декабрь 2021 Январь 2022 Февраль 2022 Март 2022 Апрель 2022 Май 2022 Июнь 2022 Июль 2022 Август 2022 Сентябрь 2022 Октябрь 2022 Ноябрь 2022 Декабрь 2022 Январь 2023 Февраль 2023 Март 2023 Апрель 2023 Май 2023 Июнь 2023 Июль 2023 Август 2023 Сентябрь 2023 Октябрь 2023 Ноябрь 2023 Декабрь 2023 Январь 2024 Февраль 2024 Март 2024 Апрель 2024
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
25
26
27
28
29
30
Game News |

How do I check for memory leaks, and what should I do to stop them?

 How do I check for memory leaks, and what should I do to stop them?

You may have heard the phrase, "You can never be too rich, too thin, or have too much RAM." RAM is a vital part of a computer system, providing for computer data storage via volatile memory. The current recommended amount for a new system build is 16GB of RAM, with 32GB more suitable these days for those who want to "future-proof," or have more advanced needs, such as multitasking, CAD, or video editing. For even more advanced users, 64GB or 128GB of total system RAM may be easily justified.

Our computer systems have large amounts of RAM at their disposal, all to avoid running low on this all-important resource. A shortage of memory on a desktop will grind the system to a performance halt. This is because when the computer is running low (or out) of available RAM, it performs a process called “paging,” in which it swaps out data that’s in RAM to the storage drive. This creates virtual memory, which then allows the computer to continue its task. All of this shuttling of data back and forth between RAM and the slower virtual memory has a negative impact on performance, as you might guess. 

So the recommendation is to have plenty of RAM installed, with "the more RAM, the better" being the mantra.

Despite having this overabundance of RAM in modern computers, there can still be situations where the system runs out of memory. The most obvious is simultaneously running multiple memory-hogging applications—4K video editing software, or a ridiculously large number of tabs open in a browser—that use up all available memory resources. The solution to this issue is to install more RAM, and/or have the computer run fewer programs simultaneously.

What is a memory leak?

What is a memory leak?

Despite having adequate RAM and not running resource-intensive software, there can be another situation where all available RAM gets used and performance degrades. This is known as a memory leak, and it happens when software fails to manage the available RAM correctly.

With the computer functioning normally, RAM gets used by software in a dynamic fashion, and memory resources are allocated as needed. When software no longer needs the RAM resource, it is then “returned,” so that it can be reallocated to the next program when needed. In a situation with a memory leak, RAM gets allocated to the software but is not freed up when no longer needed. It’s akin to the memory getting stuck in a roach trap—“Roaches get in, but they can’t get out.” As this continues, a large chunk or even a system’s entire complement of RAM can be tied up in this dysfunctional process.

This is ultimately caused by a software bug. For example, Windows 11's File Explorer was recently said to cause a memory leak for some users. These are usually patched out pretty quickly, but they can be quite damaging to your PC's performance while they're still a problem.

What does the user experience? Unfortunately, no version of Windows flashes a popup to alert the user that a memory leak is occurring, so it’s not a simple issue to diagnose. The system can have a myriad of symptoms that point to a leak, though: decreased performance, a slowdown plus the inability to open additional programs, or it may freeze up completely. This is often exacerbated by having lots of available memory; if the leak only consumes a few MB of RAM each minute, it could be a day or two before the problem reaches the critical level.

The solutions at this point are to close the offending process in the task manager, or a system reboot, which will free up all the RAM so that the process can start again. While a reboot as a solution will get the system running again, it does not precisely diagnose the issue, nor give the user a good idea of what happened or how to avoid it happening again. It is analogous to lighting your lawn on fire just to get rid of some dandelions—too much treatment for the problem at hand.

Finding a memory leak

Tracking down a memory leak can be a difficult process. Let’s say a program runs for a brief amount of time and has a memory leak. As the process terminates, it may not be an obvious issue if there is more than adequate RAM to support other processes. However, with a longer-running program that grabs more RAM, it can eventually grab all the system’s RAM and grind your rig to a standstill.

Using Window's Resource Monitor

To find a memory leak, you’ve got to look at the system’s RAM usage. This can be accomplished in Windows by using the Resource Monitor.

In Windows 11/10/8.1:

Press Windows+R to open the Run dialog; enter "resmon" and click OK.

With Resource Monitor open, select the Memory tab.

In Windows 7:

Start > All Programs > Accessories > System Tools > Resource Monitor

Memleak Fig2

Looking at Physical Memory, start by confirming the correct amount is displayed as installed, to ensure that there isn’t a hardware issue. Now look at the amount of available memory, and the amount that’s in use. This will show if the system is running low on memory, or if there’s plenty available.

Memleak Fig3

Next, we turn our attention to the processes running that are using the memory. Rather than scrolling through the whole list, you can click "Commit (KB)," which will reorder the list so that the most memory-intensive tasks appear at the top. This makes it easy to see which software is using the most RAM. In the above example it’s "Firefox.exe," better known as the Firefox browser (for the record, there were four tabs open at the time of the screenshot). Also note that at the top of the Processes, 39 percent of physical memory was being used, indicating adequate reserves for additional processes.

Memleak Fig4

Displayed on the right side of the screen are the monitors over time, which indicate the last 60 seconds. The top panel shows the "Used Physical Memory," and we can see that it is slightly increasing over time, but there’s still a significant portion available, allowing the system to remain stable.

Limitations of Window's Resource Monitor

It’s certainly worthwhile to keep an eye on the Window's Resource Monitor, as it can show the available memory and the processes that are using the most resources. However, it also has some significant limitations.

The first is that it is not continuously monitored. It requires opening the Resource Monitor, and doesn’t run continuously in the background. As an aside, Windows Gadgets, which were introduced in Windows Vista and continued in Windows 7, offered a gadget that did this. As it turned out, these gadgets were vulnerable (as most software is), so they were discontinued and are no longer available from Microsoft. While we never thought we’d pine for Vista, this was truly a useful feature that may have been dropped a little too soon.

The other limitation is that it only goes back 60 seconds. If a memory leak occurs and the software is closed, chances are it will not be caught in the act and correctly identified as the culprit.

CleanMem Mini Monitor

So, with Windows not having a robust tool to tackle the memory leak issue, we turn our attention to a third-party software solution. It's called CleanMem Mini Monitor, which you can download here.

Memleak Fig5

CleanMem Mini Monitor is designed to sit just above the Windows System Tray in the lower right-hand corner. It’s flexible, and can be toggled on and off. This is useful, because it provides real-time status of total memory and the amount that is committed to running processes. As software is opened and closed, it’s useful to be able to see how the RAM that is used is impacted, and also to see when there’s little or no free memory available. This can also be used as a guide in your decision of whether you need to purchase additional RAM for your rig.

Memleak Fig6

In the general tab of CleanMem Mini Monitor, you can choose to run the program automatically at system startup. The background colors of green for 0–50 percent usage, yellow for 50–75 percent usage, and red for greater than 75 percent usage give a good visual indication of the RAM that’s being used, and if it’s getting critically low.

Memleak Fig7

Moar RAM

An image of the best DDR5 RAM for gaming 2022 on a blue background with a PC Gamer recommended badge.

(Image credit: Future)

Best DDR5 RAM: the latest and greatest
Best DDR4 RAM: affordable and fast

In the free version of the program, the Advanced Monitor settings are locked and not user configurable. However, they do give insight into what CleanMem Mini Monitor is doing. We can see that it is set to Auto Run every five minutes when memory usage is 75 percent or more. It’s also set to Auto Clean the file cache every five minutes when the file cache is 50MB or more. While this is generally used as a set-it-and-forget-it program, you can right click the program and run it manually as needed, too.

The more you know about what to look for and how to deal with memory leaks, the better. While CleanMem will not eliminate every memory leak issue, it does a good job of getting committed memory back to available status. While a full system reboot is the ultimate solution for RAM that is erroneously misallocated, you can improve your system stability with CleanMem, and make the reboot solution much less common.

The permanent solution of course is to get software updates for any applications or drivers that happen to have a memory leak, fixing the problem. In an ideal world, leaks wouldn't happen, but with software becoming increasingly complex, sometimes things are missed. Often, a leak will simply result in the offending application crashing (this has happened with many games where playing for hours ultimately leads to a crash-to-desktop, at which point the memory is reclaimed), but there are many other factors that can also come into play. If you're routinely getting "out of memory" errors, however, keep an eye on your memory usage using the above tools and you will likely discover a leak that needs to be plugged.



Читайте также

NASA manages to fix Voyager's garbled data problem, even though it's more than 15 billion miles away

Another Crab's Treasure review

Dark Roast Cafè is an adorably satanic, cozy game where you employ quirky demons to help run your business

Москва

RU.TV превращает Русскую Музыкальную Премию в Мюзикл

Новости тенниса



Game24.pro — паблик игровых новостей в календарном формате на основе технологичной новостной информационно-поисковой системы с элементами искусственного интеллекта, гео-отбора и возможностью мгновенной публикации авторского контента в режиме Free Public. Game24.pro — ваши Game News сегодня и сейчас в Вашем городе.

Опубликовать свою новость, реплику, комментарий, анонс и т.д. можно мгновенно — здесь.



Персональные новости

Сотрудник ОМОН «Крепость» стал бронзовым призером на соревнованиях Центрального округа Росгвардии по боксу

«Где ваши манеры?»: интервью со звездным экспертом по этикету Дианой Булатовой

Шапки женские вязаные на Wildberries, 2024 — новый цвет от 392 руб. (модель 466)

Столица двинулась на «Восток»: чем занимаются путешественники на трассе М-12