AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Belegung des internen FastMM abfragen?

Ein Thema von himitsu · begonnen am 16. Mai 2010 · letzter Beitrag vom 16. Mai 2010
Antwort Antwort
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.017 Beiträge
 
Delphi 12 Athens
 
#1

Belegung des internen FastMM abfragen?

  Alt 16. Mai 2010, 20:41
Ich versuche mal wieder über Delphi-Referenz durchsuchenGetMemoryManagerState an die Menge der Daten im Delphi-Speichermanager ranzukommen, aber egal was ich versuche, es stimmt vorne und hinten überhaupt nichts.

Aktuell bin ich hier, aber in meinem Projekt fehlen einige hundert MB.
(vorhin hatte ich sogar mal -500 MB )
Delphi-Quellcode:
Function GetMemoryLoad: Cardinal;
  Var MS: TMemoryManagerState;
    i: Integer;

  Begin
    GetMemoryManagerState(MS);
    Result := MS.TotalAllocatedLargeBlockSize
      + (MS.TotalAllocatedMediumBlockSize - MS.ReservedMediumBlockAddressSpace);
    For i := 0 to NumSmallBlockTypes - 1 do
      Result := Result - MS.SmallBlockTypeStates[i].ReservedAddressSpace
        + (MS.SmallBlockTypeStates[i].UseableBlockSize * MS.SmallBlockTypeStates[i].AllocatedBlockCount);
  End;
Das alte Delphi-Referenz durchsuchenGetHeapStatus liefert zwar "gute" Werte (TotalAllocated - Overhead),
aber es ist halt alt (deprecated).
TStringList befindet sich eine 100 MB Textdatei (Ansi), also 200 MB an Daten (Unicode eben) und dennoch werden grade Mal 50 MB angezeigt.

Wogegen der TaskManager sogar von 485 MB spricht, welches auch von GetHeapStatus in etwa bestätigt wird.


Wie berechnet man es also richtig?
(wobei es schon blöde ist, daß es in Zukunft keine nette "Übersicht" ala GetHeapStatus geben soll)
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Tryer

Registriert seit: 16. Aug 2003
200 Beiträge
 
#2

Re: Belegung des internen FastMM abfragen?

  Alt 16. Mai 2010, 21:22
Zitat:
The allocated address space is that part of the address space that is currently in use by the application, i.e. memory that was allocated through GetMem and not yet freed. The reserved address space is the amount of address space that was obtained from the operating system for current and future use by the application, i.e. the allocated address space plus all overhead.
Belegt ist also Sum(*Allocated* + [].Count * [].InternalBlockSize), insgesamt vom System angefordert ist Sum(Reserved*).
Zur Verfügung steht Sum(Reserved*) - Sum(*Allocated* + [].Count * [].UsableBlockSize).

So würde ich es mal ausprobieren.

Grüsse, Dirk

{Edit: [].Count * [].Size}
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz