1. sayfa (Toplam 1 sayfa)

Windows Retrim (TRIM) Davranışının Çoklu Örneklemli Analizi: C: ve D: Birimlerinde Zaman İçindeki Değişim

Gönderilme zamanı: 16 Tem 2026, 17:57
gönderen TRWE_2012
Merhabalar

Önceklikle aşağıda bazı verileri vereceğim.Bu veriler 48 saatlik Windows11.24H2.R7019 X64 Home İşletim Sistemi -SSD Disk- İkilisine aittir.
Resim
Bu tabloya ulaşmak için aşağıdaki .py betiğini tasarladım...

Windows Trim-Performans Grafikleri .py

Kod: Tümünü seç

import re
import matplotlib.pyplot as plt

text = r"""PASTE_LOG_HERE"""

# Helpers
def parse_num(s):
    # "65,65" -> 65.65
    return float(s.replace(",", "."))

# Her "Invoking retrim on (C:)" / "(D:)" bloğunu ayır
starts = [m for m in re.finditer(r"Invoking retrim on \(([CD]):\)", text)]
blocks = []
for i, m in enumerate(starts):
    vol = m.group(1)
    seg_start = m.start()
    seg_end = starts[i+1].start() if i+1 < len(starts) else len(text)
    seg = text[seg_start:seg_end]
    blocks.append((vol, seg))

rows = []
for vol, seg in blocks:
    used_m = re.search(r"Used space\s*=\s*([\d,\.]+)\s*GB", seg)
    free_m = re.search(r"Free space\s*=\s*([\d,\.]+)\s*GB", seg)
    total_m = re.search(r"Total space trimmed\s*=\s*([\d,\.]+)\s*GB", seg)
    backed_m = re.search(r"Backed allocations\s*=\s*(\d+)", seg)
    alloc_m  = re.search(r"Allocations trimmed\s*=\s*(\d+)", seg)

    # Beklenen alanlardan herhangi biri yoksa atla
    if not (used_m and free_m and total_m and backed_m and alloc_m):
        continue

    rows.append({
        "vol": vol,
        "used": parse_num(used_m.group(1)),
        "free": parse_num(free_m.group(1)),
        "total_trimmed": parse_num(total_m.group(1)),
        "backed_alloc": int(backed_m.group(1)),
        "alloc_trimmed": int(alloc_m.group(1)),
    })

# Run numaraları: her volume kendi sırası ile sayılır
run = {"C": 0, "D": 0}
for r in rows:
    run[r["vol"]] += 1
    r["run"] = run[r["vol"]]

c = [r for r in rows if r["vol"] == "C"]
d = [r for r in rows if r["vol"] == "D"]

# Grafikleri çiz
plt.figure(figsize=(14, 10))

# 1) Total space trimmed (GB) - iki seri
ax1 = plt.subplot(2, 2, 1)
ax1.plot([r["run"] for r in c], [r["total_trimmed"] for r in c], marker="o", label="C: Total trimmed")
ax1.plot([r["run"] for r in d], [r["total_trimmed"] for r in d], marker="o", label="D: Total trimmed")
ax1.set_title("1) Retrim: Total space trimmed (GB) vs Run")
ax1.set_xlabel("Run")
ax1.set_ylabel("GB")
ax1.grid(True, alpha=0.3)
ax1.legend()

# 2) Used/Free - iki volume için (4 çizgi)
ax2 = plt.subplot(2, 2, 2)
ax2.plot([r["run"] for r in c], [r["used"] for r in c], marker="o", label="C: Used")
ax2.plot([r["run"] for r in c], [r["free"] for r in c], marker="o", label="C: Free")
ax2.plot([r["run"] for r in d], [r["used"] for r in d], marker="o", label="D: Used")
ax2.plot([r["run"] for r in d], [r["free"] for r in d], marker="o", label="D: Free")
ax2.set_title("2) Used/Free (GB) vs Run")
ax2.set_xlabel("Run")
ax2.set_ylabel("GB")
ax2.grid(True, alpha=0.3)
ax2.legend()

# 3) Allocations trimmed (ve istersen backed) - iki seri
ax3 = plt.subplot(2, 2, 3)
ax3.plot([r["run"] for r in c], [r["alloc_trimmed"] for r in c], marker="o", label="C: Allocations trimmed")
ax3.plot([r["run"] for r in d], [r["alloc_trimmed"] for r in d], marker="o", label="D: Allocations trimmed")
ax3.plot([r["run"] for r in c], [r["backed_alloc"] for r in c], linestyle="--", alpha=0.6, label="C: Backed allocations")
ax3.plot([r["run"] for r in d], [r["backed_alloc"] for r in d], linestyle="--", alpha=0.6, label="D: Backed allocations")
ax3.set_title("3) Retrim: Allocations trimmed vs Run")
ax3.set_xlabel("Run")
ax3.set_ylabel("Count")
ax3.grid(True, alpha=0.3)
ax3.legend()

plt.tight_layout()
plt.show()
Bu python betiğinin çalışabilme şartları...

1.Sisteminizde Python yüklü olmalıdır.
2.Sisteminizde "pip install" mekanizması yüklü olmalıdır.
3.Sisteminizde "matplotlib" pyhton kütüphane birleşeni yüklü olmalıdır.

Betikle tasarlanan "Mühendislik Grafiği" şöyle tasarlandı tarafımdan...

1) SSD trim miktarı (önerilen ana grafik)

**Grafik tipi:** Çizgi grafiği (iki seri)

- **X ekseni:** Komutu kaçıncı kez çalıştırdığım (Run 1, Run 2, …) veya yaklaşık zaman
- **Y ekseni:** `Total space trimmed (GB)`
- **Seriler:**
- C: için `Total space trimmed`
- D: için `Total space trimmed`

2) Disk doluluk haritası (kullanım değişimi)

**Grafik tipi:** Çizgi grafiği veya iki çizgi (ikisi birden aynı grafikte)

- **X ekseni:** Run
- **Y ekseni:** `Used space (GB)` ve `Free space (GB)`
- **Seriler:**
- C: için used/free
- D: için used/free

3) Trimlenen “parça sayısı” (mekanik desen değişimi)

**Grafik tipi:** Dikey çubuk grafiği veya çizgi (iki seri)

- **X ekseni:** Run
- **Y ekseni:** `Allocations trimmed` (ve istersen ikinci bir seri olarak `Backed allocations`)
- **Seriler:** C: ve D: ayrı ayrı (ya da aynı grafikte iki çizgi)

Şimdi grafik ve makale konusuna malzeme olan 2 günlük (48 saat'lik) Windows komutu trim 'in istatiksel veri setini verelim...
Microsoft Windows [Version 10.0.26100.7019]
(c) Microsoft Corporation. Tüm hakları saklıdır.

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 52,76 GB
Free space = 65,63 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 142
Total space trimmed = 65,65 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,65 GB
Free space = 67,58 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 74
Total space trimmed = 67,58 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 52,76 GB
Free space = 65,63 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 207
Total space trimmed = 65,63 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,65 GB
Free space = 67,58 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 74
Total space trimmed = 67,58 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,65 GB
Free space = 67,58 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 75
Total space trimmed = 67,58 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 52,88 GB
Free space = 65,50 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 127
Total space trimmed = 65,53 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 52,93 GB
Free space = 65,46 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 115
Total space trimmed = 65,49 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,65 GB
Free space = 67,58 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 75
Total space trimmed = 67,58 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 76
Total space trimmed = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 52,99 GB
Free space = 65,40 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 96
Total space trimmed = 65,43 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,05 GB
Free space = 65,34 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 130
Total space trimmed = 65,37 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 76
Total space trimmed = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,03 GB
Free space = 65,36 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 226
Total space trimmed = 65,39 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 76
Total space trimmed = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,02 GB
Free space = 65,37 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 136
Total space trimmed = 65,40 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,30 GB
Free space = 65,09 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 108
Total space trimmed = 65,12 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 76
Total space trimmed = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,30 GB
Free space = 65,09 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 146
Total space trimmed = 65,13 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 77
Total space trimmed = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,38 GB
Free space = 65,01 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 114
Total space trimmed = 65,05 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,42 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 96
Total space trimmed = 67,42 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,37 GB
Free space = 65,02 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 128
Total space trimmed = 65,05 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,81 GB
Free space = 67,42 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 96
Total space trimmed = 67,42 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,35 GB
Free space = 65,03 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 172
Total space trimmed = 65,07 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,81 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 84
Total space trimmed = 67,42 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 118,39 GB
Cluster size = 4 KB
Used space = 53,39 GB
Free space = 65,00 GB

Retrim:
Backed allocations = 119
Allocations trimmed = 122
Total space trimmed = 65,04 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 119,23 GB
Cluster size = 4 KB
Used space = 51,82 GB
Free space = 67,41 GB

Retrim:
Backed allocations = 120
Allocations trimmed = 83
Total space trimmed = 67,41 GB
Şimdi ise bu istatiksel veriyi nasıl betik içinde kullandığımı kısaca anlatayım ki sizlerde kendiniz de kendi sistemindeki trim mekanizmasının gerçekten sağlıklı çalış-çalışmadığını kontrol edebilirsiniz.

Windows Trim-Performans Grafikleri .py betiğinde şöyle bir ifade var...

Kod: Tümünü seç

text = r"""PASTE_LOG_HERE"""
PASTE_LOG_HERE bu araya

Kod: Tümünü seç

defrag.exe C:\  /V /O /L
komutunu çıktılarını bir boş bir txt belgesine kopyala-yapıştır aktaracaksınız yada şu Win11-MS-DOS komutunu kullanabilirsiniz ;

Kod: Tümünü seç

defrag.exe C:\ /V /O /L >> C_dump.txt

Kod: Tümünü seç

defrag.exe D:\ /V /O /L >> D_dump.txt
Bu komut setlerinde tek dikkat etmeniz gereken özel nokta ;

> Tek seferde komutu yaz bırak text belgesine...Böyle yazıp kullanırsanız, eski bilgi silinir yenisi yazılır.Biz bunu istemiyoruz..O zaman komut'taki > (büyüktür=yönlendirme ) işaretinden bir tane daha yazın komuta, yani > değil, >> yazacaksınız.Böylece eski bilgi korunur, yeni bilgi bir alt satıra yazılır text belgesinde...
Resim
ÖRNEK KOMUT ÇIKTISI :

C_dump.txt

Kod: Tümünü seç

Invoking retrim on (C:)...



The operation completed successfully.

Post Defragmentation Report:


	Volume Information:
		Volume size                 = 118,39 GB
		Cluster size                = 4 KB
		Used space                  = 53,45 GB
		Free space                  = 64,94 GB


	Retrim:
		Backed allocations          = 119
		Allocations trimmed         = 112
		Total space trimmed         = 63,77 GB

Invoking retrim on (C:)...



The operation completed successfully.

Post Defragmentation Report:


	Volume Information:
		Volume size                 = 118,39 GB
		Cluster size                = 4 KB
		Used space                  = 53,45 GB
		Free space                  = 64,94 GB


	Retrim:
		Backed allocations          = 119
		Allocations trimmed         = 114
		Total space trimmed         = 64,97 GB

Invoking retrim on (C:)...



The operation completed successfully.

Post Defragmentation Report:


	Volume Information:
		Volume size                 = 118,39 GB
		Cluster size                = 4 KB
		Used space                  = 53,45 GB
		Free space                  = 64,94 GB


	Retrim:
		Backed allocations          = 119
		Allocations trimmed         = 114
		Total space trimmed         = 64,97 GB
D_dump.txt

Kod: Tümünü seç

Invoking retrim on (D:)...



The operation completed successfully.

Post Defragmentation Report:


	Volume Information:
		Volume size                 = 119,23 GB
		Cluster size                = 4 KB
		Used space                  = 51,82 GB
		Free space                  = 67,41 GB


	Retrim:
		Backed allocations          = 120
		Allocations trimmed         = 83
		Total space trimmed         = 67,41 GB

Invoking retrim on (D:)...



The operation completed successfully.

Post Defragmentation Report:


	Volume Information:
		Volume size                 = 119,23 GB
		Cluster size                = 4 KB
		Used space                  = 51,82 GB
		Free space                  = 67,41 GB


	Retrim:
		Backed allocations          = 120
		Allocations trimmed         = 81
		Total space trimmed         = 66,00 GB
İşte bu text belgelerindeki verilerin hepsini birden python betiğindeki text = r"""PASTE_LOG_HERE""" ifadesideki PASTE_LOG_HERE ifadesini silip, text = r"""BURAYA YAZ HEPSİNİ""" yazacaksınız..

ÖRNEK KOMUT DÜZENİ :

Kod: Tümünü seç

import re
import matplotlib.pyplot as plt

text = r"""Microsoft Windows [Version 10.0.26100.7019]
(c) Microsoft Corporation. Tüm hakları saklıdır.

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 52,76 GB
                Free space                  = 65,63 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 142
                Total space trimmed         = 65,65 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,65 GB
                Free space                  = 67,58 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 74
                Total space trimmed         = 67,58 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 52,76 GB
                Free space                  = 65,63 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 207
                Total space trimmed         = 65,63 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,65 GB
                Free space                  = 67,58 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 74
                Total space trimmed         = 67,58 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,65 GB
                Free space                  = 67,58 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 75
                Total space trimmed         = 67,58 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 52,88 GB
                Free space                  = 65,50 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 127
                Total space trimmed         = 65,53 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 52,93 GB
                Free space                  = 65,46 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 115
                Total space trimmed         = 65,49 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,65 GB
                Free space                  = 67,58 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 75
                Total space trimmed         = 67,58 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 76
                Total space trimmed         = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 52,99 GB
                Free space                  = 65,40 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 96
                Total space trimmed         = 65,43 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,05 GB
                Free space                  = 65,34 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 130
                Total space trimmed         = 65,37 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 76
                Total space trimmed         = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,03 GB
                Free space                  = 65,36 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 226
                Total space trimmed         = 65,39 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 76
                Total space trimmed         = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,02 GB
                Free space                  = 65,37 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 136
                Total space trimmed         = 65,40 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,30 GB
                Free space                  = 65,09 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 108
                Total space trimmed         = 65,12 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 76
                Total space trimmed         = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,30 GB
                Free space                  = 65,09 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 146
                Total space trimmed         = 65,13 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 77
                Total space trimmed         = 67,41 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,38 GB
                Free space                  = 65,01 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 114
                Total space trimmed         = 65,05 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,42 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 96
                Total space trimmed         = 67,42 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,37 GB
                Free space                  = 65,02 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 128
                Total space trimmed         = 65,05 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,81 GB
                Free space                  = 67,42 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 96
                Total space trimmed         = 67,42 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,35 GB
                Free space                  = 65,03 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 172
                Total space trimmed         = 65,07 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,81 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 84
                Total space trimmed         = 67,42 GB

C:\Windows\System32>defrag.exe C:\ /V /O /L

Invoking retrim on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 118,39 GB
                Cluster size                = 4 KB
                Used space                  = 53,39 GB
                Free space                  = 65,00 GB

        Retrim:
                Backed allocations          = 119
                Allocations trimmed         = 122
                Total space trimmed         = 65,04 GB

C:\Windows\System32>defrag.exe D:\ /V /O /L

Invoking retrim on (D:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 119,23 GB
                Cluster size                = 4 KB
                Used space                  = 51,82 GB
                Free space                  = 67,41 GB

        Retrim:
                Backed allocations          = 120
                Allocations trimmed         = 83
                Total space trimmed         = 67,41 GB
"""

def parse_num(s: str) -> float:
    return float(s.replace(",", "."))

# Her (C:) / (D:) bloğunu ayır
starts = [m for m in re.finditer(r"Invoking retrim on \(([CD]):\)", text)]
blocks = []
for i, m in enumerate(starts):
    vol = m.group(1)
    seg_start = m.start()
    seg_end = starts[i + 1].start() if i + 1 < len(starts) else len(text)
    blocks.append((vol, text[seg_start:seg_end]))

rows = []
for vol, seg in blocks:
    used_m = re.search(r"Used space\s*=\s*([\d,\.]+)\s*GB", seg)
    free_m = re.search(r"Free space\s*=\s*([\d,\.]+)\s*GB", seg)
    total_m = re.search(r"Total space trimmed\s*=\s*([\d,\.]+)\s*GB", seg)
    backed_m = re.search(r"Backed allocations\s*=\s*(\d+)", seg)
    alloc_m = re.search(r"Allocations trimmed\s*=\s*(\d+)", seg)

    if not (used_m and free_m and total_m and backed_m and alloc_m):
        continue

    rows.append({
        "vol": vol,
        "used": parse_num(used_m.group(1)),
        "free": parse_num(free_m.group(1)),
        "total_trimmed": parse_num(total_m.group(1)),
        "backed_alloc": int(backed_m.group(1)),
        "alloc_trimmed": int(alloc_m.group(1)),
    })

# Run numaraları: her volume kendi içinde sırayla
run = {"C": 0, "D": 0}
for r in rows:
    run[r["vol"]] += 1
    r["run"] = run[r["vol"]]

c = [r for r in rows if r["vol"] == "C"]
d = [r for r in rows if r["vol"] == "D"]

# Grafikleri çiz
plt.figure(figsize=(14, 10))

# 1) Total trimmed
ax1 = plt.subplot(2, 2, 1)
ax1.plot([r["run"] for r in c], [r["total_trimmed"] for r in c], marker="o", label="C: Total trimmed")
ax1.plot([r["run"] for r in d], [r["total_trimmed"] for r in d], marker="o", label="D: Total trimmed")
ax1.set_title("1) Retrim: Total space trimmed (GB) vs Run")
ax1.set_xlabel("Run")
ax1.set_ylabel("GB")
ax1.grid(True, alpha=0.3)
ax1.legend()

# 2) Used/Free
ax2 = plt.subplot(2, 2, 2)
ax2.plot([r["run"] for r in c], [r["used"] for r in c], marker="o", label="C: Used")
ax2.plot([r["run"] for r in c], [r["free"] for r in c], marker="o", label="C: Free")
ax2.plot([r["run"] for r in d], [r["used"] for r in d], marker="o", label="D: Used")
ax2.plot([r["run"] for r in d], [r["free"] for r in d], marker="o", label="D: Free")
ax2.set_title("2) Used/Free (GB) vs Run")
ax2.set_xlabel("Run")
ax2.set_ylabel("GB")
ax2.grid(True, alpha=0.3)
ax2.legend()

# 3) Allocations trimmed (ve istersen backed)
ax3 = plt.subplot(2, 2, 3)
ax3.plot([r["run"] for r in c], [r["alloc_trimmed"] for r in c], marker="o", label="C: Allocations trimmed")
ax3.plot([r["run"] for r in d], [r["alloc_trimmed"] for r in d], marker="o", label="D: Allocations trimmed")
ax3.plot([r["run"] for r in c], [r["backed_alloc"] for r in c], linestyle="--", alpha=0.7, label="C: Backed allocations")
ax3.plot([r["run"] for r in d], [r["backed_alloc"] for r in d], linestyle="--", alpha=0.7, label="D: Backed allocations")
ax3.set_title("3) Retrim: Allocations trimmed vs Run")
ax3.set_xlabel("Run")
ax3.set_ylabel("Count")
ax3.grid(True, alpha=0.3)
ax3.legend()

plt.tight_layout()
plt.show()
Şimdi makale anlatımına geçebiliriz, iyi okumalar

1. Giriş

Katı hâl sürücülerinde (SSD) performansın ve veri bütünlüğünün korunması, işletim sisteminin boşta kalan bloklar hakkında depolama denetleyicisini düzenli olarak bilgilendirmesine bağlıdır. Windows bu işlevi defrag.exe <Birim>: /V /O /L komutuyla gerçekleştirir; burada /L parametresi retrim (TRIM/discard sinyallerinin yeniden tetiklenmesi) işlemini başlatır, /O ortam türüne (SSD/HDD) uygun optimizasyon yöntemini seçer, /V ise ayrıntılı (verbose) çıktı üretir.

Bu çalışmada, iki gün açık kalan bir sistemde C: (118,39 GB) ve D: (119,23 GB) birimleri üzerinde ardışık biçimde 14 kez (C:) ve 13 kez (D:) çalıştırılan retrim komutlarının çıktıları düzenli ifadeler (regex) ile ayrıştırılmış, ardından Toplam trim edilen alan, Kullanılan/Boş alan ve Trim edilen tahsis (allocation) sayısı metrikleri run bazında görselleştirilmiştir. Amaç, bu üç grafikten çıkan örüntüleri yorumlayarak sistemin depolama davranışı hakkında teknik bir değerlendirme sunmaktır.

2. Gelişme

2.1. Ölçüm Özeti
Resim
Resim
2.2. Grafik 1 — Toplam Trim Edilen Alan (GB) vs Run

Her iki birimde de "Total space trimmed" değeri, ilgili birimin boş alan değeriyle neredeyse birebir örtüşmektedir (C: fark ≤ 0,03 GB, D: fark ≈ 0). Bu, retrim komutunun teknik olarak "şu an boş kabul edilen tüm alanı" TRIM adayı olarak rapor ettiğini doğrulamaktadır; yani bu değer bir "kazanç" ölçüsü değil, her çalıştırmada denetleyiciye bildirilen toplam boş blok hacmidir. C: biriminde eğim hafif azalan yönde (65,65 → 65,04 GB), bu da zaman içinde C: üzerinde net veri birikimi olduğunu (kullanıcı etkinliği, güncelleme, önbellek/geçici dosya yazımı) gösterir. D: biriminde ise değişim yalnızca 0,17 GB’lık bir bant içinde kalmış, pratik olarak durağan bir profil sergilemiştir.

2.3. Grafik 2 — Used/Free (GB) vs Run

C: biriminde kullanılan alan 52,76 GB’tan 53,39 GB’a monotonik ve düşük eğimli bir artış göstermiştir (~0,63 GB / 14 run). Bu artış ani sıçramalar içermediğinden, arka planda çalışan bir sızıntı (leak) veya anormal disk şişmesi değil, normal sistem/kullanıcı etkinliğinin (güncelleme, önbellek, geçici dosyalar) birikimli etkisi olarak değerlendirilebilir. D: biriminde kullanılan alan pratik olarak sabittir (51,65–51,82 GB), bu da D: biriminin bu iki günlük pencerede statik veri deposu (program/oyun/arşiv) işlevi gördüğünü, aktif yazma trafiğine maruz kalmadığını göstermektedir.

2.4. Grafik 3 — Allocations Trimmed vs Run

Bu grafik, analizin en bilgilendirici bölümüdür ve iki birim arasında belirgin bir davranışsal ayrışma ortaya koymaktadır:

Backed allocations her iki birimde de sabittir (C: 119, D: 120). Bu değer, retrim mekanizmasının "izlenen/korunan" tahsis birimi sayısını temsil eder ve dosya sistemi meta veri yapısının bu süre zarfında değişmediğini gösterir; parçalanma (fragmentation) göstergesi değildir.

Allocations trimmed ise C: biriminde 96 ile 226 arasında yüksek varyansla (standart sapma 35,8) salınmakta, D: biriminde ise çok daha dar bir bantta (74–96, standart sapma 7,5) seyretmektedir. C: birimindeki bu sayısal örüntü, ardışık retrim çağrıları arasında boş alanın kaç ayrı parçaya (fragment) bölündüğünün her seferinde farklılaşmasından kaynaklanır; bu da işletim sistemi diski (sayfalama dosyası, önbellek, geçici dosyalar, tarayıcı verisi) üzerindeki sık küçük yazma/silme etkinliğinin doğal bir sonucudur. D: biriminde bu sayının düşük ve stabil kalması, birimin çok daha az küçük-dosya trafiğine maruz kaldığını doğrulamaktadır.

D: biriminde run 10–11 civarında görülen sıçrama (74–76 bandından ~95–96’ya çıkış, ardından 83–84’e kısmi geri dönüş), bu pencerede D: üzerinde tekil bir yazma olayı (örn. güncelleme, kurulum veya büyük dosya işlemi) yaşandığına işaret edebilir; ancak bu, C: birimindeki kalıcı sayısal değer düzeyinin çok altında kalmıştır.

2.5. Teknik Değerlendirme

Bu veri seti, disk sağlığı ile ilgili bir bulgu içermemektedir; ölçülen tüm metrikler (backed allocations sabitliği, used/free bandının darlığı) sistemin retrim açısından öngörülebilir ve istikrarlı çalıştığını göstermektedir. "Allocations trimmed" değerindeki dalgalanma, bir SSD arızası veya anormal aşınma göstergesi değil, anlık boş alan parçalanma durumunun fotoğrafıdır ve her retrim çağrısı bağımsız bir anlık görüntü (snapshot) olduğundan doğası gereği dinamiktir.

3. Sonuç

İncelenen 14 (C:) ve 13 (D:) örneklemlik retrim verisi, iki birimin farklı kullanım profillerine sahip olduğunu net biçimde ortaya koymaktadır: C: birimi aktif işletim sistemi/kullanıcı etkinliği nedeniyle hem kullanılan alanda hafif ve düzenli bir artış hem de trim edilen tahsis sayısında yüksek varyans sergilerken; D: birimi düşük yazma trafiğine sahip, durağan bir depolama alanı olarak davranmaktadır. Backed allocations değerlerinin her iki birimde de sabit kalması, dosya sistemi meta veri düzeninin bu süreçte bozulmadığını doğrulamaktadır. Bulgular herhangi bir müdahale gerektirmemekte olup, mevcut donanım ömrü izleme rutinine (Log Page 0x04, Victoria analizleri) tamamlayıcı bir zaman serisi verisi olarak eklenebilir; istenirse betiğin çıktısı otomatik bir günlük dosyasına yönlendirilerek uzun vadeli bir trend takibi kurulabilir.

Yani işin özeti :

Bu sonuçlar “sorun var” mı diyor?

Hayır. Şunlar pozitif olduğu sürece sistem'de sorun yok demektir.

- Her seferinde **The operation completed successfully.**
- TRIMlenen toplam alan **tamamen saçmalamıyor**, istikrarlı bir bantta kalıyor.
- `Used/Free` değerleri tutarlı şekilde değişiyor.

Google SEO HasTag's :

#WindowsRetrimAnalysis
#SSDTrimPerformance
#NVMeStorageOptimization
#DefragExeCommandLine
#DiskSpaceUsageTrend
#TrimAllocationVariance
#WindowsStorageMaintenance
#SSDWearLevelingInsights

Teşekkürler vakit ayırıp okuduğunuz için....(TRWE_2012)

Re: Windows Retrim (TRIM) Davranışının Çoklu Örneklemli Analizi: C: ve D: Birimlerinde Zaman İçindeki Değişim

Gönderilme zamanı: 19 Tem 2026, 12:55
gönderen burak35
Hiç uğraşmıyorum valla. Kendi haline bıraktım sistemi. ne yapıyorsa yapsın.