in reply to Am I mistaken about Moose 'DEMOLISH'?
Following your suggestion, I stumbled-upon Test::Memory::Cycle (from my re-re-readings of Task::Kensho), and ran it.
Although there were no strong memory-cycles, there are two weakened ones:
# Cycle #1 # BAH::MyMojo::Context A->{_session_schema} => # BAH::Schema::WebSchema B # BAH::Schema::WebSchema B->{source_registrations} => %C # %C->{WsSession} => DBIx::Class::ResultSource::Table D # w->DBIx::Class::ResultSource::Table D->{schema} # => BAH::Schema::WebSchema B # Cycle #2 # BAH::MyMojo::Context A->{_session_schema} # => BAH::Schema::WebSchema B # BAH::Schema::WebSchema B->{storage} # => DBIx::Class::Storage::DBI::mysql E # w->DBIx::Class::Storage::DBI::mysql E->{schema} # => BAH::Schema::WebSchema B
My guess is that the schema-classes are causing the problem. (I confess that I don't quite understand how to read the dump... is the percent-sign in “%C” meant to signify a weak-ref?) But anyhow, I can work around the issue, and I think that I just discovered another useful test-tool.
Hmmm.... No matter what you want, or want to do, it's in CPAN somewhere ... if only you can (a) find it, and (b) understand it once you find it. My batting-average so far is not that good... :*)