Ticket #420 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

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.

Attachments

instances.diff Download (7.5 KB) - added by tpk 3 years ago.
Suggested patch.

Change History

Changed 3 years ago by tpk

Suggested patch.

Changed 3 years ago by hans

  • priority changed from normal to high
  • status changed from new to assigned
  • type changed from defect to task
  • summary changed from instance pooling to Add ability to disable instance pooling

Changed 3 years ago by hans

  • status changed from assigned to closed
  • resolution set to fixed

Initial change by tpk in [630]. Added some minor changes in [631].

Changed 3 years ago by hans

In [632] changed getInstanceFromPool() to only return a found instance if pooling is enabled.

Note: See TracTickets for help on using tickets.