我有 CodeGear C++ Builder XE5。使用 TIdTCPServer 创建的服务器,效果很好。但是服务使用的内存正在增长。我终于设法包含了完整版的 FastMM4 内存管理器,在摆弄选项后,我发现内存泄漏的确认:
13 - 20 bytes: TIdThreadSafeInteger x 1
21 - 36 bytes: TIdCriticalSection x 2, Unknown x 1
53 - 68 bytes: UnicodeString x 1
85 - 100 bytes: Unknown x 21
149 - 164 bytes: Unknown x 21
181 - 212 bytes: Unknown x 2
显然 x1 和 x2 不关心我,但是 x21 泄漏很糟糕,因为这是一个高度使用的服务 - 每个连接流血 100 和 164 字节:
更多详细信息指出:
A memory block has been leaked. The size is: 100
This block was allocated by thread 0xD98, and the stack trace (return addresses) at the time was:
8D4743 [Unknown function at @@Zip_int@Finalize]
8D461D [Unknown function at @@Zip_int@Finalize]
8E0F94 [Unknown function at @@Zip_int@Finalize]
8E0F59 [Unknown function at @@Zip_int@Finalize]
8DFADA [Unknown function at @@Zip_int@Finalize]
8DE722 [Unknown function at @@Zip_int@Finalize]
8BF045 [Unknown function at @@Searchfilelist@Finalize]
8C4C90 [Unknown function at @@Searchfilelist@Finalize]
8D6638 [Unknown function at @@Zip_int@Finalize]
775D1C77 [Unknown function at RtlNtStatusToDosErrorNoTeb]
452A45 [@Fastmm4@DebugGetMem$qqri]
The block is currently used for an object of class: Unknown
A memory block has been leaked. The size is: 164
This block was allocated by thread 0x5394, and the stack trace (return addresses) at the time was:
8D4743 [Unknown function at @@Zip_int@Finalize]
8D461D [Unknown function at @@Zip_int@Finalize]
8E0FD9 [Unknown function at @@Zip_int@Finalize]
8E0F59 [Unknown function at @@Zip_int@Finalize]
8DFADA [Unknown function at @@Zip_int@Finalize]
8DE722 [Unknown function at @@Zip_int@Finalize]
8BF045 [Unknown function at @@Searchfilelist@Finalize]
8C4C90 [Unknown function at @@Searchfilelist@Finalize]
8D6638 [Unknown function at @@Zip_int@Finalize]
775D1C77 [Unknown function at RtlNtStatusToDosErrorNoTeb]
452A45 [@Fastmm4@DebugGetMem$qqri]
The block is currently used for an object of class: Unknown
The allocation number is: 125893
在这一点上我被卡住了,我不知道这是为了什么,因为我不直接调用 Zip_int。谁能指出我正确的方向?