You are not logged in.
Pages: 1
I've got memory leaks in TSynLog, looks like the problem is from GarbageCollectorFreeAndNil()
The version I'm using: mORMot and Open Source friends 2014-07-16 0910
I assume My derived TSynLog class doesn't affect this?
stack traces by madExcept - I got a lot of entries like this:
allocation number: 38186
type: AnsiString
address: $b1e3318
size: 46
access rights: read/write
code page: 65001
reference counter: 1
string length: 32
contents: AllocNewSequentialFeedMediumPool
thread $17ec (TOmniThread):
671cb40a madExcept32.dll madExceptDbg 1500 GetMemCallback
00406a94 MyProgram.exe System 4189 @GetMem
0040a6a7 MyProgram.exe System 22313 @NewAnsiString
0040a8f2 MyProgram.exe System 23046 @LStrFromPCharLen
0069e6a7 MyProgram.exe SynCommons 39226 ReadSymbol
0069f69e MyProgram.exe SynCommons 39461 LoadMab
0069f958 MyProgram.exe SynCommons 39504 TSynMapFile.Create
006a20b4 MyProgram.exe SynCommons 40802 TSynLog.LogFileHeader
0052b98a MyProgram.exe System.Classes 6915 TStream.Seek
006a2e87 MyProgram.exe SynCommons 40906 TSynLog.LogHeaderLock
006a349f MyProgram.exe SynCommons 40999 TSynLog.LogInternal
006a1c69 MyProgram.exe SynCommons 40697 TSynLog.Log
memory dump:
0b1e3318 e9 fd 01 00 01 00 00 00 - 20 00 00 00 41 6c 6c 6f ........ ...Allo
0b1e3328 63 4e 65 77 53 65 71 75 - 65 6e 74 69 61 6c 46 65 cNewSequentialFe
0b1e3338 65 64 4d 65 64 69 75 6d - 50 6f 6f 6c 00 00 edMediumPool..
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Ab, quite standard, except I use a derived class:
http://synopse.info/forum/viewtopic.php?id=1891
One thing came to my mind - I free the logger object manually, I not sure if that affects GarbageCollectorFreeAndNil()
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
We do not use nor test manually handled TSynLog, just class-level TSynLog instances.
Your derived class is mixing both single instance (T*Log.Create) and class-level parameters (using Family).
I suppose this is breaking everything.
Offline
ab, i need to do that because each thread must has its own log file.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Arnaud, it's a little more complex then that, - I also need to control the log file name, so that:
- I can load the most recent log entries the next time my program runs.
- Imagine my program has a concept called "profile" - I keep only one log file for each "profile" in my program.
Can I achieve that without using a derived class I mentioned above? Thanks!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
AFAIR you can not use a TSynLog class instance, without accessing its per-class TSynLogFamily settings.
In this case, sub-class you own TSynLog type, then use it as you which in your own application.
Offline
Update 1: Downloaded the latest svn from github, the memory leaks are gone
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Rule 1: always download the latest "unstable" version from GitHub, our fossil repository, or http://synopse.info/files/mORMotNightlyBuild.zip
Offline
Arnaud, yes, you are right
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1