I have an application in Delphi 5, legacy, that after some implementations, Access Violation and Out of system resources began to occur at different points and no obvious reason for the problem occurs.
This system has several cast, where the main class can become several classes.
Example:
(Teste as TCaixa).Element
What or how can I do to try to discover the source of the problem?