Project

General

Profile

Actions

Feature #1435

open

Wt::Dbo: implement mark&sweep to break circular dependencies

Added by Koen Deforche over 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/11/2012
Due date:
% Done:

0%

Estimated time:

Description

See Wt-interest discussion with Boris Nagaev:

I think, Wt::Dbo should behave as memory manager: longly unused

objects go to swap (i.e. to database, ptr.flush() && ptr.purge()).

Because of lazy loading, this can be done. In this case circular

dependency would not be a problem. Could you implement it, please?

The main problem is that we currently depend on reference counting. What you are really suggesting is that we also do a 'mark' and 'sweep' garbage collection. I've never considered this before, but indeed, it might make sense since Wt::Dbo indeed has a centralized knowledge on all objects, and it has everything in place to implement the traversal. In that case we can simply break the cycle as the corrective action, which should normally lead to a normal (but post-poned) action.

I'm not sure how this will work in practice (how to configure this 'mark&sweep'), but I suspect that in reality most sessions will only have a very low number of objects that are being kept around during user think-time and thus there is indeed opportunity to do this every so many requests.

No data to display

Actions

Also available in: Atom PDF