It is currently March 29th, 2024, 1:40 pm

Top Memory Process Numeric for RoundMeter

Get help with creating, editing & fixing problems with skins
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Top Memory Process Numeric for RoundMeter

Post by fonpaolo »

Oh, yes, you're right, as always.
Sorry... :oops:

I often use to play with words, but saying and writing something with the same words isn't really the same...
I use double quotes and emoticons trying to give the words the right meaning and characterization.
In this case I haven't thought the implications of my words, it's hard to understand the real meaning on something written and sometimes I must read my comments a few times before I click the submit button.

My apologies.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: Top Memory Process Numeric for RoundMeter

Post by bill98 »

JSMorely - Lets start again. I believe AdvancedCPU provides the top CPU process. I want the Top MEMORY Process percent or size value to use in a RoundMeter.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Top Memory Process Numeric for RoundMeter

Post by jsmorley »

bill98 wrote:JSMorely - Lets start again. I believe AdvancedCPU provides the top CPU process. I want the Top MEMORY Process percent or size value to use in a RoundMeter.
Ah, sorry, I obviously misread. I don't have a solution for that at hand...
User avatar
Grim
Posts: 56
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: Top Memory Process Numeric for RoundMeter

Post by Grim »

So I've been thinking about this since you posted. If there was a way to grab cmd output and display it you could do:
tasklist /NH | sort /+65 /R

That said I'm still trying to find a way to pull only the top 10.

Output looks like this:

Code: Select all

C:\Windows\system32>tasklist /NH | sort /+65 /R
firefox.exe                   7380 Console                    1    783,448 K
explorer.exe                  2200 Console                    1    177,368 K
OUTLOOK.EXE                   5672 Console                    1    113,660 K
csrss.exe                      516 Console                    1     97,412 K
svchost.exe                    976 Services                   0     96,628 K
FlashPlayerPlugin_11_9_90     6396 Console                    1     85,728 K
svchost.exe                   1200 Services                   0     78,116 K
svchost.exe                   1020 Services                   0     72,288 K
dwm.exe                       3444 Console                    1     65,036 K
svchost.exe                   1132 Services                   0     45,104 K
svchost.exe                    920 Services                   0     43,388 K
lsass.exe                      580 Services                   0     35,844 K
svchost.exe                    756 Services                   0     33,920 K
svchost.exe                   1236 Services                   0     32,284 K
tsclient.exe                  1720 Console                    1     32,216 K
tsclient.exe                  8112 Console                    1     29,296 K
spoolsv.exe                   1488 Services                   0     28,840 K
services.exe                   564 Services                   0     28,796 K
audiodg.exe                   3464 Services                   0     27,412 K
svchost.exe                   1528 Services                   0     25,960 K
notepad++.exe                 7416 Console                    1     24,956 K
pidgin.exe                    4576 Console                    1     21,700 K
Rainmeter.exe                 8160 Console                    1     20,208 K
svchost.exe                    832 Services                   0     19,788 K
Cut off here as there was more...
Now if Rainmeter was able to pull in WMI info and/or Windows PowerShell stuff this would probably be much easier.

Powershell for top 10 memory hogs:
PS C:\> get-process | sort ws -descending | select -first 10
Output:

Code: Select all

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
   1000      73   763532     834748  1325   575.77   7380 firefox
   1234      88    75028     177328   403   521.70   2200 explorer
   4821      61   108668     111884   661   390.95   5672 OUTLOOK
    812      18    12212      97436   312   138.09    516 csrss
    437      12    75176      96464   174 1,011.90    976 svchost
    293      18    83768      82808   236    30.14   6396 FlashPlayerPlugin_...
    335      15     7780      78216   123   152.60   1200 svchost
   1337      32    37492      71412   248   417.38   1020 svchost
    171      12   126496      64752   316 2,101.65   3444 dwm
    315      11    47136      48856   191     1.51   5068 powershell
Will come back to this if I find anything cause I'm interested in this functionality too. Even more so If I find a way to pull in WMI objects.

Side Note/FYI:
WMI = Windows Management Instrumentation
- Backwards compatible with older Windows OS (Pre Win8)
- Some Classes contain Methods for modifying Instances, but for the most part is Read Only

Going forward with Winblows 8+ MS is migrating to CIM although WMI is still supported.
CIM = Common Information Model

If your interested in the type of information you can pull in with WMI grab this little VBS/HTA app called Scriptomatic and see.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Top Memory Process Numeric for RoundMeter

Post by moshi »

User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Top Memory Process Numeric for RoundMeter

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]
GetLine=.*(.*)\r\n
GetName=(?siU)^(.*)[ ]{1,} 
GetKBytes=(?si).* ([,0-9]{1,}) K$

[MeasureUpdate]
Measure=Calc
Formula=1
UpdateDivider=5
OnUpdateAction=[!CommandMeasure MeasureMemory Run]

[MeasureMemory]
Measure=Plugin
Plugin=RunCommand
Parameter=tasklist /NH | sort /+65 /R
OutputFile=#CURRENTPATH#Memory.txt
OutputType=ANSI
FinishAction=[!CommandMeasure MeasureParse "Update"][!UpdateMeasure MeasureParse]

[MeasureParse]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Memory.txt
RegExp=(?siU)#GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine#
UpdateRate=86400
UpdateDivider=-1

[MeasureName1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetName#
StringIndex=1
StringIndex2=1

[MeasureMemory1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetKBytes#
StringIndex=1
StringIndex2=1
Substitute=",":""

[MeasureMemory1Number]
Measure=Calc
Formula=([MeasureMemory1] * 1024)
DynamicVariables=1

[MeasureName2]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetName#
StringIndex=2
StringIndex2=1

[MeasureMemory2]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetKBytes#
StringIndex=2
StringIndex2=1
Substitute=",":""

[MeasureMemory2Number]
Measure=Calc
Formula=([MeasureMemory2] * 1024)
DynamicVariables=1

...

[MeterName1]
Meter=String
MeasureName=MeasureName1
FontSize=12
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1

[MeterMemory1]
Meter=String
MeasureName=MeasureMemory1Number
X=200
Y=0r
FontSize=12
FontColor=255,255,255,255
StringAlign=Right
AutoScale=1
AntiAlias=1

[MeterName2]
Meter=String
MeasureName=MeasureName2
X=0
Y=4R
FontSize=12
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1

[MeterMemory2]
Meter=String
MeasureName=MeasureMemory2Number
X=200
Y=0r
FontSize=12
FontColor=255,255,255,255
StringAlign=Right
AutoScale=1
AntiAlias=1

...
2014-02-28_134624.jpg
http://docs.rainmeter.net/tips/webparser-using-stringindex2
You do not have the required permissions to view the files attached to this post.
User avatar
Grim
Posts: 56
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: Top Memory Process Numeric for RoundMeter

Post by Grim »

jsmorley wrote:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]
GetLine=.*(.*)\r\n
GetName=(?siU)^(.*)[ ]{1,} 
GetKBytes=(?si).* ([,0-9]{1,}) K$

[MeasureUpdate]
Measure=Calc
Formula=1
UpdateDivider=5
OnUpdateAction=!CommandMeasure MeasureMemory Run

[MeasureMemory]
Measure=Plugin
Plugin=RunCommand
Parameter=tasklist /NH | sort /+65 /R
OutputFile=#CURRENTPATH#Memory.txt
OutputType=ANSI
FinishAction=[!CommandMeasure MeasureParse "Update"][!UpdateMeasure MeasureParse]

[MeasureParse]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Memory.txt
RegExp=(?siU)#GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine##GetLine#
UpdateRate=86400
UpdateDivider=-1

[MeasureName1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetName#
StringIndex=1
StringIndex2=1

[MeasureMemory1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetKBytes#
StringIndex=1
StringIndex2=1
Substitute=",":""

[MeasureMemory1Number]
Measure=Calc
Formula=([MeasureMemory1] * 1024)
DynamicVariables=1

[MeasureName2]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetName#
StringIndex=2
StringIndex2=1

[MeasureMemory2]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParse]
RegExp=#GetKBytes#
StringIndex=2
StringIndex2=1
Substitute=",":""

[MeasureMemory2Number]
Measure=Calc
Formula=([MeasureMemory2] * 1024)
DynamicVariables=1

...

[MeterName1]
Meter=String
MeasureName=MeasureName1
FontSize=12
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1

[MeterMemory1]
Meter=String
MeasureName=MeasureMemory1Number
X=200
Y=0r
FontSize=12
FontColor=255,255,255,255
StringAlign=Right
AutoScale=1
AntiAlias=1

[MeterName2]
Meter=String
MeasureName=MeasureName2
X=0
Y=4R
FontSize=12
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1

[MeterMemory2]
Meter=String
MeasureName=MeasureMemory2Number
X=200
Y=0r
FontSize=12
FontColor=255,255,255,255
StringAlign=Right
AutoScale=1
AntiAlias=1

...
2014-02-28_134624.jpg
http://docs.rainmeter.net/tips/webparser-using-stringindex2
NICE! :yahoo:
User avatar
Grim
Posts: 56
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: Top Memory Process Numeric for RoundMeter

Post by Grim »

Just realized that this does work, but there's a small problem. It's constantly writing to the temp file thus using cycles on the drive. Not so good. So for that reason scrapped this from my skin.