Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the FSA-Rules CPAN distribution.

Report information
The Basics
Id: 89533
Status: resolved
Priority: 0/
Queue: FSA-Rules

People
Owner: Nobody in particular
Requestors: arfreitas [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.31
Fixed in: 0.32



Subject: memory leak in FSA::States
Greetings, I detected a memory leak problem with FSA::Rules. Due the usage of lexical %machines and %states hash tables that keep references of all objects, the FSA::Rule object and FSA::States associated with it are not release from memory because their references count will keep higher than zero until the termination of the program. I attached a patch that will make both hash tables accessible as package variables, which will make possible to remove the references as necessary, making it possible that the respective DESTROY method from the objects will be invoked as soon as the references are removed. To do that, I added to the patch the free_refs methods, which should destroy all references for the specific FSA::Rule object. This method must be invoked when the FSA::Rule object is not necessary anymore, probably at the end of lexical context where it was declared. It would be also interesting to do the same in the destruct method from objects, although I cannot say that the DESTROY method from FSA::Rule and FSA::State will be invoked before the end of the destructor method.
Subject: patch-0.31
Download patch-0.31
application/octet-stream 1.5k

Message body not shown because it is not plain text.