Delphi - Проверить, освобождается ли память «вовремя»

У меня есть приложение с графическим интерфейсом , которое не имеет утечки памяти. Я подтвердил это с FastMM в ходе многочисленных циклов тестирования. On one particular client's server, I get random crashes. The server specs are well in line with that of our other clients (and we have actually tried on various hardware), and so are the files used by the program (as far as I can tell, There is some super-sensitive material that I can't get access to, but there doesn't seem to be anything out of the ordinary there).

I have tried the likes of EurekaLog and MadShi, to maybe narrow down the issue, but unfortunately, they only seem to catch an exception at the time of the crash on occasion, not all the time. When it does, it usually shows one or more "Out of memory" error prior to the crash.

So I'm thinking maybe some objects get freed "too late", i.e. only when the application is shutting down, as opposed to when I mean to free them? I've seen the FastMMUsageeTracker demo, but couldn't really make sense of it all. Is there documentation anywhere? Or could someone put in (somewhat accessible) words how I could go about checking for this?

Alternatively, what would be the best approach to detect that the application is approaching its "memory limit", so as to take some preventive action? If I understand properly, a regular Delphi app being 32bit, it should be fine handling up to 2Gb of memory (provided the hardware supports it of course), correct?

PS: Delphi 2009 or XE, if that's relevant

Thanks!

EDIT - Issue possibly solved

We were able to find an issue where a pop-up window that closes and frees itself automatically after a while was being created at a much faster rate than it was disappearing. This would eat a huge amount of memory over time, and then any memory allocation would basically bring it over the edge and trigger the "out of memory" problem.

This would explain why the stack traces where inconsistent.

I'm not entirely convinced this is our only issue, as, even though unlikely, this scenario could well have happened before in the years our application has been running, but somehow it hasn't. I'll do a lot more digging on this issue.

Thanks to all who responded, each answer actually has valuable info in it.

7
задан Bourgui 10 March 2011 в 16:37
поделиться