SSD's life expectancy

General discussion for topics related to the FreeBASIC project or its community.
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

@srvaldez

21! Flaming heck. Ah, you have a new box. My technology is 22 nm - yours is probably thinner and runs cooler.

Anyway, are you saying that you now have SYSTEM EXTRA on your desktop?
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: SSD's life expectancy

Post by srvaldez »

@deltarho[1859]
yes, thank you for the system extra and for the instructions :-)
the CPU temp goes up with the load, but when idle it's between 21 and 25 C
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

srvaldez wrote:yes, thank you for the system extra and for the instructions :-)
Well done.

I should say that it is nearly two years since I did anything with Rainmeter and since my memory is not what it was I was not 100% confident that my setting up advice would work. So, I will now say well done me. Image There are others way to introduce a skin but I cannot remember what they are.

If you look at Core Temp Max. temps after a Restart or a Cold Boot you will see much higher temp figures. The amount of work done during those tasks is enormous and the CPU max temps bears that out.

If my CPU ever showed 21 I'm sure that my system would throw a message at me saying "Put the central heating on for goodness’ sake." The cooler a CPU runs the longer it will live so 21/25 is great and miles away from your Tj.Max.
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

@jj2007

I dropped a 1GiB file onto my C: drive and the Disk skin did not change - I had to refresh the skin to see a change in Disk usage. The question is why is it pooling every second? I will have to check out the script.
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

@jj2007

Although DISK pools every second there was another variable called UpdateDivider which causes updates at that number of cycles. That was set at 120 meaning an actual update of 1000ms * 120 giving every two minutes. WHAT?

I did a bit of searching and found that UpdateDivider is normally 5 for disks giving 1000ms * 5 giving an actual update every 5 seconds. That is more like it. It is probably not a good idea to check disk usage every second, so I stayed with 5 seconds.

On dropping a 1GiB onto my C: drive the disk usage changed quickly - I was probably close to an actual update.

On deleting the 1GiB on my C: drive no change occurred but then 'muggins' here realized that it was now in the Recycle Bin so it wouldn't change, would it? I emptied the Recycle Bin and a few seconds later the disk usage dropped.

So, DISK is real time but it needed the UpdateDivider reducing.

I went into Process Explorer to see how expensive DISK was and Rainmeter's CPU usage now varied between 0.04% and 0.07% so no pressure there then.

I will leave the revised DISK just above SYSTEM EXTRA on my desktop just in case something decides to drop piles of files onto C: Perhaps I could edit DISK to show disk usage as red if it goes beyond a certain threshold. Perhaps another day, I could do with a lie down now.

Added: When dropping the 1GiB file onto C: I noticed that it now had a hiberfil.sys. I don't use one - I don't hibernate. I bet a Windows Update dropped that there. Anyway, I deleted it and got 6GiB back - 'yer gotta' laugh.
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

@srvaldez

If I remember the DISK skin folder comes with the RainMeter package. On the other hand I think I got the PerfMon folder as a separate download.

Anyway, I am looking at the '1 Disk' skin with a view to editing it and looked at my revised SYSTEM skin for tips - as we do. I found 'MeasurePagePeakLights' and wondered why I used that name. My memory is getting bad - I was thinking of the UK traffic lights - Red/Amber/Green. I got the 67% right, mentioned above, but what I actually have is <= 67% is green, 67% to 81% is amber and > 81% is red. So, when my friend found himself in the red zone he was above 81% and why I chipped in suggesting he increase the pagefile. Of course, if we find ourselves doing that again then it may be time to get more RAM. In fact, my friend did just that and bought another 8GiB to put next to his existing 8GiB and his system was a little livelier for it.

So, if your pagefile peak ever shows a highish amber figure then keep a close eye on it. If the commit peak ever shows a highish amber figure that is telling us we are using a fair amount of virtual memory which will be helped by either increasing the pagefile or getting more RAM.

Added: I wrote "we are using a fair amount of virtual memory". I should have written "we have committed a fair amount of virtual memory", which is not the same thing - committed will be greater than used. The conclusion is correct - increase the pagefile or get more RAM. We could, of course, start shutting stuff down to reduce the committed memory. I have had seconds thoughts about commit usage/peak - it is a good metric.
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

If anyone is interested I have written a new version of '1 Disk.ini' and called it '1 Disk New.ini'. '1 Disk.ini' displays '<used space> / <total formatted space>'. The <total formatted space> will never change and I don't need to be told what that is.

'1 Disk New.ini' displays '<used space> / <used space %>' like this.
Image

The amber bar is a graphical representation of %. That is also used with SYSTEM EXTRA but I forgot to mention that.

I knew how much my old C: drive used and when I got my current machine I reckoned that a 120GB unformatted internal SSD would do me. Well, with Windows 10 my space usage is a lot higher than with Windows 7 but, as you can see, I don't use a lot on C:, even now.

The polling is every 5 seconds, so we will wait between just shy of 5 seconds for an update or almost immediately giving an average long term update of 2½ seconds. That will do me. The 5 seconds is by using UpdateDivider=5 in '1 Disk New.ini'. If you want a 'bang up to date' evaluation then simply right click on the display and click 'Refesh skin'.

I was thinking of using a traffic light system on the percentage usage but decided not to - I will leave it up to you to decide when the percentage usage is getting high. The accepted 'rule of thumb' is keep 15% to 20% free on HDDs and 25% free on SSDs. We should be able to leave less than 25% on modern SSDs via, what is called, overprovisioning but that depends on the SSD, so I'd stick with 25%.

Just drop '1 Disk New.ini' into the .../illustro/Disk folder.

1 Disk New.zip

I have put DISK just above SYSTEM EXTRA. For precise positioning hold down Control/Alt and click on the DISK display. You can now use the arrow keys to move DISK one pixel at a time. Rainmeter is very cleverly written.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: SSD's life expectancy

Post by dodicat »

hi Deltarho[]
messing around win 10

Code: Select all


Function pipeout(Byval s As String="") Byref As String
    Var f=Freefile
    Dim As String tmp
    Open Pipe s For Input As #f 
    s=""
    Do Until Eof(f)
        Line Input #f,tmp
        s+=tmp+Chr(10)
    Loop
    Close #f
    Return s
End Function

Function StringSplit(s_in As String,chars As String,result() As String) As Long
    Dim As Long ctr,ctr2,k,n,LC=Len(chars)
    Dim As boolean tally(Len(s_in))
    #macro check_instring()
    n=0
    While n<Lc
        If chars[n]=s_in[k] Then 
            tally(k)=true
            If (ctr2-1) Then ctr+=1
            ctr2=0
            Exit While
        End If
        n+=1
    Wend
    #endmacro
    
    #macro split()
    If tally(k) Then
        If (ctr2-1) Then ctr+=1:result(ctr)=Mid(s_in,k+2-ctr2,ctr2-1)
        ctr2=0
    End If
    #endmacro
    '==================  LOOP TWICE =======================
    For k  =0 To Len(s_in)-1
        ctr2+=1:check_instring()
    Next k
    If ctr=0 Then
        If Len(s_in) Andalso Instr(chars,Chr(s_in[0])) Then ctr=1':beep
    End If
    If ctr Then Redim result(1 To ctr): ctr=0:ctr2=0 Else  Return 0
    For k  =0 To Len(s_in)-1
        ctr2+=1:split()
    Next k
    '===================== Last one ========================
    If ctr2>0 Then
        Redim Preserve result(1 To ctr+1)
        result(ctr+1)=Mid(s_in,k+1-ctr2,ctr2)
    End If
    Return Ubound(result)
End Function

Sub main
    Var s=pipeout ("wmic logicaldisk get size,freespace,caption")
    
    Redim As String a()
    StringSplit(s,Chr(13,10,32),a())
    Redim Preserve a(Lbound(a) To Ubound(a)+2)
    For n As Long=Lbound(a) To Ubound(a)
       ' print n,a(n) 'checker
    Next
    
    Dim As String d(1 To 24)
    For n As Long=1 To 24
        d(n)=Chr(66+n)+":"
    Next n
    
    #macro numbers(n1,n2)
    Var factor=1/1024/1024/1024
    Var freespace= Val(a(n1))*factor
    Var totspace= Val(a(n2))*factor
    Var used=(totspace-freespace)
    #endmacro
    
    #macro show(n)
    Print "Drive ";a(n)
    Print "Total space ";totspace;Tab(35);" Gb"
    Print "Used space  ";used;Tab(35);" Gb";" (";str(csng(100*used/totspace));" %)"
    Print "Free space  ";freespace ;Tab(35);" Gb";" (";str(csng(100*freespace/totspace));" %)"
    Print
    #endmacro
    
    Dim As Long start=1
    
    For n As Long=Lbound(a) To Ubound(a)
        Select Case a(n)
        Case d(start)
            If Len(a(n+1)) And a(n+1)<>d(start+1)  Then
                numbers((n+1),(n+2))
                show(n)
            End If 
            start+=1
        End Select
    Next
    Sleep
End Sub

main

 
Last edited by dodicat on Feb 09, 2020 10:38, edited 2 times in total.
deltarho[1859]
Posts: 4313
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: SSD's life expectancy

Post by deltarho[1859] »

Hi dodicat

I cannot remember if I published this or not - I cannot find it. I am using wmic as well.

Compile as a gui - a console opens and closes quickly with the output as a message box. I'm only looking at free space. On my system it shows eight drives including external drives ( SSD (I) and Flash drive (H) ) and a RAM disk (R MiB).

The point about the Rainmeter DISK skin is that it is real time and not just a snap shot. SYSTEM EXTRA is also real time.

Code: Select all

#Include Once "windows.bi"
Dim As WString * 32768 sBuffer
Dim As String NewBuffer
Dim As Uinteger x, BufferEnd
Dim As Double FreeSpace, TotalSpace, PerCent

Shell( "wmic logicaldisk get size,freespace,caption > DS.txt" )
Open "DS.txt" For Binary As #1
  Get #1, , sBuffer
  x = InStr( sBuffer, Chr(13,10) ) + 2
  Do
    NewBuffer += "  " + Mid( sBuffer, x, 2)
    FreeSpace = Val( Mid(sBuffer, x + 2) )
    TotalSpace = Val( Mid(sBuffer, x + 23) )
    PerCent = 100*FreeSpace/TotalSpace
    If FreeSpace < 1073741824 Then
      FreeSpace /= (1024*1024)
      NewBuffer += "  " + str( Int(FreeSpace) ) + " MiB" + " " + IIf(FreeSpace = 0, " ", " " + str(Int(PerCent)) + "%") + Chr(13,10)
    Else
      FreeSpace /= (1024*1024*1024)
      NewBuffer += "  " + str( Int(FreeSpace) ) + " GiB" + " " + IIf(FreeSpace = 0, " ", " " + str(Int(PerCent)) + "%") + Chr(13,10)
    End If
    BufferEnd = InStr( x, sBuffer, Chr(13,10) )
    x = BufferEnd + 2
  Loop Until  InStr( x, sBuffer, Chr(13,10) ) = 0
Close #1
Kill "DS.txt"
messagebox( Null, NewBuffer, "Disk free space", mb_ok )
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: SSD's life expectancy

Post by dodicat »

Thanks Deltarho[]
I have fixed a small bug in mine.
But yes, kinda the same, I use pipe into a string instead of a file, and split this string up.
Yours is neater.
Aparich
Posts: 2
Joined: Feb 03, 2020 4:39

Re: SSD's life expectancy

Post by Aparich »

srvaldez wrote:perhaps you may have concerns about the life expectancy of your SSD https://www.youtube.com/watch?v=-XZNr7mS0iw
I still make regular backup to a mechanical HD, don't trust these SSD's
I recently bought an SSD for my laptop and didn't care about its life expectancy till now. Thanks for sharing this.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: SSD's life expectancy

Post by srvaldez »

@deltarho[1859]
thank you :-)
Post Reply