Ticket #420 (closed task: fixed)
Add ability to disable instance pooling
| Reported by: | tpk | Owned by: | hans |
|---|---|---|---|
| Priority: | high | Milestone: | 1.3 |
| Component: | Generator | Version: | devel |
| Severity: | normal | Keywords: | instance pooling memory leak |
| Cc: |
Description
It should be possible to disable object instance pooling, as storing the instances means they are not garbage-collectible. This is a problem for long running processes, which can either consume loads of memory for not good reason or the developer needs to keep track of relevant peer classes to run clearInstancePool() on them.
Suggested solution:
Introduce a flag in propel to disable/enable instance pooling (enabled by default) and centralize the pool management in getInstanceFromPool() / addInstanceToPool() / removeInstanceFromPool() etc methods.
That involves adding methods like (enable/disable)InstancePooling() to propel and modifying all the code that right now accesses self::$instances directly in the peer classes to use the methods that deal with pooling.

