Smart trim doesn't work

Started by empleat, June 07, 2020, 12:18:06 PM

Previous topic - Next topic

empleat

I checked documentation, but there is nothing else, that i wouldn't know already. Here is my setting, yet standby memory reaches 9000MB and process lasso still doesn't act. I have problem. I have 16GB ram, but if i set page file to small value, my game freezes, while i have over 8GB memory free... And task manager says roughly: system has not enough memory, close some process to free memory. While i don't want to use page file to not wear down ssd and i don't want to have it on hdd, because when things loads i might have freezes.

EDIT: setting was previously even on 1 minute.

edkiefer

#1
It seems to be working here on my end, what are the smarttrim log messages saying?
Note it will only trim in 15min intervals as you have it set, should see log every 15min then.

PS: I would strongly recommend setting a pagefile up, even if it is a small one like min 2048- max 4096 as an example.
Bitsum QA Engineer

Jeremy Collake

#2
Wearing the SSD is a psychological concern more than technical. I advise to let the system manage your page file size. It is important to have a page file of sufficient size, else you can can get in a situation where you have MORE paging because the system is trying to operate properly within the constraints of that tiny page file.

In any event, SmartTrim can only do so much, and isn't going to help you to have a smaller (or no) page file. There quite often won't be anything to page out, and things that are paged out are likely to come right back into RAM as soon as they are referenced. Normally the system already pages out infrequently referenced RAM, as necessary. Probably you aren't seeing any log entries because nothing needs done (everything is under the parameters set).

Alternatively, SmartTrim can be set to act or not when Performance Mode is active, so that could be the issue.

Finally, clearing the standby list flushes your file cache that normally occupies free RAM, so do that infrequently.
Software Engineer. Bitsum LLC.

empleat

#3
Quote from: edkieferIt seems to be working here on my end, what are the smarttrim log messages saying?
Note it will only trim in 15min intervals as you have it set, should see log every 15min then.
Nah, i was playing more than 30 minutes and it was set to 1m previously and did nothing all time! In log there is nothing concerning trim. I will test that more today and maybe try performance mode, if it do anything.

Quote from: Jeremy Collake on June 08, 2020, 07:19:24 AM
Wearing the SSD is a psychological concern more than technical. I advise to let the system manage your page file size. It is important to have a page file of sufficient size, else you can can get in a situation where you have MORE paging because the system is trying to operate properly within the constraints of that tiny page file.

In any event, SmartTrim can only do so much, and isn't going to help you to have a smaller (or no) page file. There quite often won't be anything to page out, and things that are paged out are likely to come right back into RAM as soon as they are referenced. Normally the system already pages out infrequently referenced RAM, as necessary. Probably you aren't seeing any log entries because nothing needs done (everything is under the parameters set).

Alternatively, SmartTrim can be set to act or not when Performance Mode is active, so that could be the issue.

Finally, clearing the standby list flushes your file cache that normally occupies free RAM, so do that infrequently.
Thing is i had even 8GB free ram and my game frozen, because page file was too low. How is wearing ssd psychological concern more than technical ? If you set page file to 3GB+, that's 3GB each time you restart pc. And when you are using it, who knows how many times it is rewritten. Problem is i have 8GB free ram, but memory leak cause my game to freeze, because all memory is filled with standby memory slowly and standby memory is never released. I checked with ram map and game itself already allocates standby memory. That memory, windows caching, is useless. If i clear all standby memory, game works perfectly even with standby memory 0. I read that even with people with 32 GB having crashes/freezes, because memory leak... Page file is from times computers had 512 ram and windows had to cache a lot, it is completely useless. You shouldn't be forced to use page file with 16GB+ ram, but Microsoft not gonna fix anything. If they cared, they would probably fix this years ago. Most of the games work fine without page file, but some won't start and memory leak is problem, if you don't clear standby memory often they freeze...


EDIT: It doesn't at all, i tried performance mode, but all ram is filled with stand by memory. I rechecked setting and every setting rule was met, yet process lasso don't trim ram at all.

Jeremy Collake

#4
I am sorry, but there are a lot of misunderstandings here. A page file is an integral part of the virtual memory system. It isn't there solely because of legacy concerns when computers had less RAM. Many processes operate on the assumption that it is there, having infrequently accessed pages stored in it (else they would manage their memory use differently). You generally want unused stuff to be paged out so that your RAM can be used for more important purposes, like a disk cache. Towards that end, you WANT your free RAM to be filled by cached data. It is the fastest storage you have. That is why the free RAM is filled with cache, Windows is doing its best to use it to its maximum advantage.

Sure, you could theoretically get by without a page file, but then you have a hard limit on virtual memory, a limit you are apparently exceeding.

Your page file isn't normally written out in entirety every time the PC is restarted, though can be zero initialized with some settings.

You can get the MTBF data for your SSD and do the math on how long it would take to wear out. There is a reason you don't hear of this ever happening. That is why it isn't a technical concern.

The Standby List has nothing to do with any memory leak by a game (though a system memory leak could occur there, in theory). Memory leaks in games would manifest in application virtual memory load.

I can't say why your game freezes, but I would caution against making assumptions about the cause.

It is not yet clear why SmartTrim isn't operating for you.
Software Engineer. Bitsum LLC.

empleat

Quote from: Jeremy Collake on June 08, 2020, 06:27:10 PM
I am sorry, but there are a lot of misunderstandings here. A page file is an integral part of the virtual memory system. It isn't there solely because of legacy concerns when computers had less RAM. Many processes operate on the assumption that it is there, having infrequently accessed pages stored in it (else they would manage their memory use differently). You generally want unused stuff to be paged out so that your RAM can be used for more important purposes, like a disk cache. Towards that end, you WANT your free RAM to be filled by cached data. It is the fastest storage you have. That is why the free RAM is filled with cache, Windows is doing its best to use it to its maximum advantage.

Sure, you could theoretically get by without a page file, but then you have a hard limit on virtual memory, a limit you are apparently exceeding.

Your page file isn't normally written out in entirety every time the PC is restarted, though can be zero initialized with some settings.

You can get the MTBF data for your SSD and do the math on how long it would take to wear out. There is a reason you don't hear of this ever happening. That is why it isn't a technical concern.

The Standby List has nothing to do with any memory leak by a game (though a system memory leak could occur there, in theory). Memory leaks in games would manifest in application virtual memory load.

I can't say why your game freezes, but I would caution against making assumptions about the cause.

It is not yet clear why SmartTrim isn't operating for you.

I am not expert on Windows memory management, but if that was true, than how come:

1. When i have a game e.g. Battlefield 3, which has recommended specs - 4GB of ram. Game freezes/crashes when standby memory is filled without using a page file. This is true even for 16GB ram. It didn't happen only to me... It was infamous, i read many forum posts about this. And even with 32GB ram some games crash, if you don't use a page file! Which should be more than any game could ever need currently.
2. If i clear every bit of standby memory, game works perfectly without freezes afterwards, even standby memory is like 100MB at the moment. If standby memory was so important, than shouldn't game be freezing when there is all of the sudden no standby memory ? Yet it works completely fine without standby memory, this is true for any game!
3. Because memory leak game crashes once all free memory is filled with standby memory. Problem here is that standby memory is never released and once all free memory is occupied and game needs something written to memory and there is no space it either:
- crashes with, or without some error
- freezes
Is it only coincidence, that game freezes at the precise exact moment, when there is no more free memory left ? I don't think so. It even says system needs more memory loosely in task manager.
4. Why if i use standby memory cleaner set to clean standbymemory often and use no page file, game never crashes/freezes. Except game is freezing on a moment at the exact time standby memory is cleared. But than works perfectly with no standby memory at all.




 

Jeremy Collake

I don't have answers your observations. Nobody does afaik. There is a lot of complexity in these systems, so diagnosing problems like yours, and the interaction between systems, is non-trivial. If some action ameliorates your issues, then do it.

As an application developer, I encourage people to use my software to run their PCs like they want. Towards that end, I really only care about ensuring SmartTrim is acting properly. Ed is attempting to reproduce any issue, but so far hasn't, and so your problem is unclear.
Software Engineer. Bitsum LLC.

edkiefer

Quote from: empleat on June 08, 2020, 08:55:07 PM
I am not expert on Windows memory management, but if that was true, than how come:

1. When i have a game e.g. Battlefield 3, which has recommended specs - 4GB of ram. Game freezes/crashes when standby memory is filled without using a page file. This is true even for 16GB ram. It didn't happen only to me... It was infamous, i read many forum posts about this. And even with 32GB ram some games crash, if you don't use a page file! Which should be more than any game could ever need currently.
2. If i clear every bit of standby memory, game works perfectly without freezes afterwards, even standby memory is like 100MB at the moment. If standby memory was so important, than shouldn't game be freezing when there is all of the sudden no standby memory ? Yet it works completely fine without standby memory, this is true for any game!
3. Because memory leak game crashes once all free memory is filled with standby memory. Problem here is that standby memory is never released and once all free memory is occupied and game needs something written to memory and there is no space it either:
- crashes with, or without some error
- freezes
Is it only coincidence, that game freezes at the precise exact moment, when there is no more free memory left ? I don't think so. It even says system needs more memory loosely in task manager.
4. Why if i use standby memory cleaner set to clean standbymemory often and use no page file, game never crashes/freezes. Except game is freezing on a moment at the exact time standby memory is cleared. But than works perfectly with no standby memory at all.





No matter what your setting or if it above the threshold to trigger you should see trim log events.
Make sure you have smart trim log events enabled in options.

Maybe post your ini file here so we can look at it (default path = C:\Users\[user name]\AppData\Roaming\ProcessLasso\config\prolasso.ini).
As I have not been able to repro your issue at all.
Bitsum QA Engineer

empleat

Here you go, i included again process lasso's settings so you can see everything is set correctly. It trimmed something couple times, but it is unclear what. Also trimmed memory in that time frame was negligible and had no impact. Standby memory filled all free memory, if i didn't use page file - game would have frozen.

What concerns trimming, i wasn't sure if it is even possible to trim intelligently standby memory. When i installed this program, i wasn't sure it would work. That's why i created this post to ask about it. But you didn't say anything and asked me to post logs etc. I so assume it is supposed to trim standby memory effective so it doesn't come to memory leak, why would you else said it is the issue.

As for what jeremy said, it is probably microsoft issue, it must be. It happens to many people across different games. So it is not a program issue... Also i heard someone say that standby memory filling free ram isn't a problem, but memory compression is. Windows supposedly tries to compress memory once free memory is filled with standby memory and that causes the issue.

PS: it doesn't let me post ini, extension not allowed. https://www.sendspace.com/file/pzf08j And performance mode was on, it was trimming something.

edkiefer

#9
Ok, on ini file, just open it with notepad and copy/paste it into the post. You can easily open it by going to the menu "file">"manually edit config file".

Also, I would like to see logs, take a pic of that would be helpful and I could tell you if smarttrim is trimming a process or if standby is doing anything.
Just so you know, to only trim standby you don't need "trim this working set" enabled but I would leave it for the test.
I would uncheck "only purge while in performance mode" just to simplify things.

I have not tested smarttrim w/o pagefile but i doubt that would change anything.
Edit: Tested w/o pagefile and works as it should.

FWIW; I game with BF1, BF4 and BFV, when windows 1803 came out there was an issue with standby list that would cause a stutter after free memory was taken by standby list cache. This got fixed or at least improved for many users in 1909.
Bitsum QA Engineer

empleat

Quote from: edkiefer on June 09, 2020, 06:43:32 PM
Ok, on ini file, just open it with notepad and copy/paste it into the post. You can easily open it by going to the menu "file">"manually edit config file".

Also, I would like to see logs, take a pic of that would be helpful and I could tell you if smarttrim is trimming a process or if standby is doing anything.
Just so you know, to only trim standby you don't need "trim this working set" enabled but I would leave it for the test.
I would uncheck "only purge while in performance mode" just to simplify things.

I have not tested smarttrim w/o pagefile but i doubt that would change anything.
Edit: Tested w/o pagefile and works as it should.

FWIW; I game with BF1, BF4 and BFV, when windows 1803 came out there was an issue with standby list that would cause a stutter after free memory was taken by standby list cache. This got fixed or at least improved for many users in 1909.

I sent you log already.

For settings you gave me, Process Lasso makes no logs and free memory is 43, yet it does nothing.

ini file:
[Administration]
Version=4830200
ConfigPasswordMD5=
[OutOfControlProcessRestraint]
OocOn=false
ExcludeChildrenOfForeground=true
DisableProBalanceWhenSysIdle=false
ProBalanceDropOneRandomCore=false
OocDisableCoreParkingWhileIn=false
DisableProBalanceIfSysIdleThisManyMS=30000
TotalProcessorUsageBeforeRestraint=18
PerProcessUsageBeforeRestraint=20
TimeOverQuotaBeforeRestraint=900
PerProcessUsageForRestore=5
PlayOnRestraint=C:\Windows\media\Windows Pop-up Blocked.wav
PlayOnRestore=C:\Windows\media\Windows Feed Discovered.wav
MinimumTimeOfRestraint=4200
MaximumTimeOfRestraint=0
TameOnlyNormal=true
LowerToIdleInsteadOfBelowNormal=false
ExcludeServices=true
PlaySoundOnRestraint=false
PlaySoundOnRestore=false
RestrainByAffinity=false
RestraintAffinity=
ExcludeForegroundProcesses2=true
DoNotLowerPriorityClass=false
RoundRobinAffinitySelection=false
LowerIOPriorityDuringRestraint=false
MatchExclusionsByPathnameToo=false
OocExclusions=
OocHardCodedExclusionOverrides=
[GUI]
ClearLogAtExit=false
ShowCPUCoreUtilGraphs=true
ShowGraphLegend=true
ShowGraphCPU=true
ShowGraphResponsiveness=true
ShowGraphMemoryLoad=true
ShowGraphProBalanceEvents=true
ShowGraphSelectedProcessesCPUHistory=true
ProBalanceCountersOnGraph=true
ShowGraphLicenseName=true
[Advanced]
AutomaticUpdate=false
RoundRobinSkipCore0=false
[Performance]
DefaultsLevel=327942
GracefulWaitTimeInMs=1000
UpdateSpeedGUI=1000
UpdateSpeedCore=1000
ManageOnlyCurrentUser=false
ExitOnCloseWindow=false
SoundsOff=true
AggressivelyTrimProcessLassoWorkingSet=true
IsConfigWritable=true
ForcedMode=false
IgnoreProtectedProcesses=true
IgnoreSuspendedProcesses=false
[ForegroundBoosting]
BoostForegroundThread=false
BoostForegroundProcess=false
ForegroundBoostExclusions=
[SystemTrayIcon]
UseStaticIcon=false
ShowResponsivnessInTrayInsteadOfProcessorUsage=false
[Logging]
LogDisable=false
LogSmartTrim=true
LogCPULimiter=true
LogEmitCSV=false
LogPruning=true
LogProBalanceParkingChanges=false
LogProcessExecutions=false
LogProcessTerminations=false
LogProcessesDisallowed=true
LogDefaultPriorityAdjustments=true
LogDefaultAffinityAdjustments=true
LogProBalanceBegin=true
LogProBalanceEnd=true
LogInstanceLimitTerminations=true
LogPowerProfileChanges=true
[MemoryManagement]
SmartTrimIsEnabled=true
SmartTrimWorkingSetTrims=false
SmartTrimClearStandbyList=true
ClearStandbyFreeRAMThresholdMB=15000
ClearStandbyOnlyInPerfMode=false
SmartTrimAutoMinimumRAMLoad=10
MinimumProcessWSSInMb=100
SmartTrimIntervalMins=1
[SysTrayBalloons]
EnableSystemTrayNotification=false
BalloonTipDuration=10000
ShowBalloonsForOocPriorityRestoration=false
[ProcessAllowances]
ApplyInstanceCountLimitsToAllUsers=false
AllowedProcesses=
DisallowedProcesses=
InstanceLimitedProcesses=
InstanceManagedCPUAffinities=
ProcessThrottles=
OneTimeProcessThrottles=
CPULimitRules=
[ProcessDefaults]
DefaultPriorities=
DefaultIOPriorities=
DefaultMemoryPriorities=
DisableThreadPriorityBoost=
DefaultAffinities=
KeepRunningProcesses=
MatchWildcardsToPathnames=true
MatchOnCommandLine=false
[AdvancedRules]
DivideCPUPercentThresholdsBySystemCPUCount=false
ProcessorGroupExtended=
WatchdogRules2=
[GamingMode]
GamingModeEnabled=false
GamingChangePowerPlan=true
TargetPowerPlan=Bitsum Highest Performance
GamingModeEngageForSteam=true
AutomaticGamingModeProcessPaths=
[MemoryManagement]
SmartTrimExclusions=
[PowerManagement]
Display=
PC=
[PowerSaver]
ShowNotificationWhenActivePowerSchemeChanges=true
PowerSaver_IdleTime=0
EnergySaverEnabled=false
EnergySaverForceActivePowerProfile=false
EnergySaverUpPowerProfileName=
EnergySaverEvents=true
DisableEnergySaverDuringGamingMode=true
PowerSaver_Exclusions=

edkiefer

I don't see anything in config that would stop smarttrim. I noticed you have Probalance set off, not that that would affect smarttrim.

At this point, only thing I can recommend is to make a new profile and see if that fixes it.
Menu >Files>Profile>create lasso profile
Bitsum QA Engineer

empleat

I didn't expect much anyway. I don't know any program, that could trim standby memory intelligently. It is more of Windows issue. And they won't fix it probably. Or they would already probably and for what they all care you can use page file and microsoft is $@@#^t@!!#$!