AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Von Sharemem zu FastMM

Ein Thema von Blamaster · begonnen am 7. Apr 2011 · letzter Beitrag vom 9. Mai 2011
Antwort Antwort
Seite 1 von 2  1 2   
Blamaster

Registriert seit: 20. Jul 2007
230 Beiträge
 
#1

Von Sharemem zu FastMM

  Alt 7. Apr 2011, 11:38
Hi,

ich wollte um nicht immer die borland dll einbindne zu müssen nun auf FastMM umsteigen.

Ich habe FastMM in jedem dpr File an erster Stelle eingetragen. (Sowohl im Hauptprogramm als auch in den Dll´s)

Mit dem Sharemem kam es nie zu exceptions oder dergleichen. Mit FastMM bekomme ich nun exceptions wie

Zitat:
---------------------------
Debugger Fault Notification
---------------------------
Project Project1.exe raised too many consecutive exceptions: 'access violation at 0x00000000: read of address 0x00000000'. Process Stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
Woran kann das liegen ? Wie gesagt mit ShareMem lief alles bestens.

Gruß Yannic
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu
Online

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

AW: Von Sharemem zu FastMM

  Alt 7. Apr 2011, 12:22
Welche Delphi-Version?

Hast du mal deinen Debugger gefragt, wo dieser Fehler auftritt?


Man kann fastMM uch mit zusätzlichem Debugcode ausführen lassen (steht Alles in der zugehörigen OH).
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Blamaster

Registriert seit: 20. Jul 2007
230 Beiträge
 
#3

AW: Von Sharemem zu FastMM

  Alt 7. Apr 2011, 12:30
Hi,

Delphi 7

Der Debugger öffnet bei der Exception ein CPU Fenster "Thread #1064"

Wie man mit dlls sauber debuggen kann habe ich irgendwie noch nicht so ganz raus.

Gruß Yannic
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu
Online

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

AW: Von Sharemem zu FastMM

  Alt 7. Apr 2011, 12:44
DLL-Projekt im Delphi öffnen und im Menü unter Start > Parameter > hostanwendung die EXE angeben ... F9 startet dann die EXE und debuggt die DLL oder BPL.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Blamaster

Registriert seit: 20. Jul 2007
230 Beiträge
 
#5

AW: Von Sharemem zu FastMM

  Alt 7. Apr 2011, 13:33
So funktioniert das also

Problem war, dass ich auf ein bereits freigegebenes object zugreifen wollte.

Gruß Yannic

Achso eine Frage habe ich noch. Ich habe mir den "FastMM4 Options" Manager besorgt.

Welche Obtionen sollte man unter dem Punkt "Memory Manager sharing" setzen ?

Zur Auswahl stehen:
- ShareMM
- ShareMMIf Libary
- Attempt to use ShareMM
- EnableBackwardCompileMMSharing

Und kann die Main Apllication mit den gleichen FastMM Einstellungen compiliert werden wie die dll ?
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu
Online

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

AW: Von Sharemem zu FastMM

  Alt 7. Apr 2011, 14:33
Es gibt im FastMM-Verzeichnis eine Include-Datei (options.inc oder so) ... darin stehen auch nochmal einige Erklärungen zu den einzelnen Werten.

PS: da gibt es auch eine option, welche derartige Zugriffe, auf bereits freigegebene Objekte, aufspürt oder zumindestens dabei helfen soll.


Wird die DLL statisch geladen, dann muß mindestens Folgendes eingestellt sein (oder alles überall aktiv):
in der DLL > freigeben für Sharen, also das andere Module diesen Speichermanager mit nutzen dürfen
in der EXE > es soll der Andere genutzt werden, wenn ein anderer MM gefunden wurde


[add]
http://www.shenturk.com/sources/self...MM4Options.inc
Delphi-Quellcode:
{Allow sharing of the memory manager between a main application and DLLs that
were also compiled with FastMM. This allows you to pass dynamic arrays and
long strings to DLL functions provided both are compiled to use FastMM.
Sharing will only work if the library that is supposed to share the memory
manager was compiled with the "AttemptToUseSharedMM" option set. Note that if
the main application is single threaded and the DLL is multi-threaded that you
have to set the IsMultiThread variable in the main application to true or it
will crash when a thread contention occurs. Note that statically linked DLL
files are initialized before the main application, so the main application may
well end up sharing a statically loaded DLL's memory manager and not the other
way around. }

{$define ShareMM}

{Allow sharing of the memory manager by a DLL with other DLLs (or the main
application if this is a statically loaded DLL) that were also compiled with
FastMM. Set this option with care in dynamically loaded DLLs, because if the
DLL that is sharing its MM is unloaded and any other DLL is still sharing
the MM then the application will crash. This setting is only relevant for
DLL libraries and requires ShareMM to also be set to have any effect.
Sharing will only work if the library that is supposed to share the memory
manager was compiled with the "AttemptToUseSharedMM" option set. Note that
if DLLs are statically linked then they will be initialized before the main
application and then the DLL will in fact share its MM with the main
application. This option has no effect unless ShareMM is also set.}

{$define ShareMMIfLibrary}

{Define this option to allow sharing between the default memory manager and
FastMM. This option only works together with the memory manager of BDS2006.
With this option enabled FastMM can be shared with applications using the
Delphi 2006 MM and vice versa. (You may have to add SimpleShareMem.pas to the
project using the Delphi 2006 memory manager to enable sharing.)}

{$define EnableSharingWithDefaultMM}

{Define this to attempt to share the MM of the main application or other loaded
DLLs in the same process that were compiled with ShareMM set. When sharing a
memory manager, memory leaks caused by the sharer will not be freed
automatically. Take into account that statically linked DLLs are initialized
before the main application, so set the sharing options accordingly.}

{$define AttemptToUseSharedMM}
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests

Geändert von himitsu ( 7. Apr 2011 um 14:38 Uhr)
  Mit Zitat antworten Zitat
Blamaster

Registriert seit: 20. Jul 2007
230 Beiträge
 
#7

AW: Von Sharemem zu FastMM

  Alt 7. Apr 2011, 15:15
Alles klar Danke
  Mit Zitat antworten Zitat
Blamaster

Registriert seit: 20. Jul 2007
230 Beiträge
 
#8

AW: Von Sharemem zu FastMM

  Alt 22. Apr 2011, 16:11
Hi,

ich muss das Thema nun nochmal ausgraben.

Das Programm ist nun soweit fertig, aber nun muss ich wie es aussieht die FullDebugMode.dll mitgeben. Wie lässt sich der FullDebug Mode komplett deaktivieren, so das auch keine externe dll mehr benötigt wird ?

Gruß Yannic
  Mit Zitat antworten Zitat
generic

Registriert seit: 24. Mär 2004
Ort: bei Hannover
2.415 Beiträge
 
Delphi XE5 Professional
 
#9

AW: Von Sharemem zu FastMM

  Alt 22. Apr 2011, 22:50
Ja, du brauchst nur den "Debug" Schalter nicht setzten (es sein denn du hast an den Options.inc rungefummelt).
Coding BOTT - Video Tutorials rund um das Programmieren - https://www.youtube.com/@codingbott
  Mit Zitat antworten Zitat
Blamaster

Registriert seit: 20. Jul 2007
230 Beiträge
 
#10

AW: Von Sharemem zu FastMM

  Alt 24. Apr 2011, 20:46
Hi,

doch die Options.inc wurde mit dem "FastMM Options Interface geändert".

Was muss getan werden, um den Debugmode mit der Dll vollständig zu deaktivieren ?

Gruß Yannic
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2   

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 21:31 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