package TestApp::Controller::Leaktest; use strict; use warnings; use Moose; use utf8; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller' } sub index :Path :Args(0) { my ($self, $context) = @_; my $model = $context->model(); $c->response->body(""); $c->response->status(400); 1; } sub modules :Local { my( $self, $c, @path ) = @_; { no strict; # We're accessing $VERSION by symbolic reference no warnings 'uninitialized'; # The $VERSION might not be defined $c->response->body(join "\n", map { s!/!::!g; # We're getting a file name... s!.pm$!!; # ...and want a module name sprintf "%-80s %s", $_, ${"${_}::VERSION"} } sort keys %INC); } $c->response->content_type("text/plain"); $c->stash->{current_view} = 'Nop'; 1; } sub exit :Local :Args(0) { exit(0); } 1; #### package TestApp::Model::KiokuDB; use Moose; BEGIN { extends 'Catalyst::Model::KiokuDB'; } __PACKAGE__->config( model_class => 'KiokuX::Model', model_args => { dsn => 'couchdb::uri=http://127.0.0.1:5984/lb-local', } ); 1; #### #!/bin/bash URL="http://localhost:3000/leaktest" EXIT="http://localhost:3000/leaktest/exit" APPNAME="testapp_server.pl" PID=$(pgrep -f ${APPNAME}) if [[ -z $PID ]]; then echo "Please start ${APPNAME} first!" exit 1; fi echo -e "HITS\tSZ\tRSS" echo -ne "0\t" ps -p ${PID} -o size,rss | sed -ne '2s/[ ]\+/\t/gp' for OUTER in $(seq 1 10); do for INNER in $(seq 1 1000); do ( curl $URL 2>&1) > /dev/null done echo -ne "$((${OUTER} * 1000))\t" ps -p ${PID} -o size,rss | sed -ne '2s/[ ]\+/\t/gp' done ( curl ${EXIT} 2>&1) > /dev/null #### Catalyst 5.80032 Catalyst::Action -1, set by base.pm Catalyst::Action::RenderView 0.16 Catalyst::Devel 1.31 Catalyst::Model::KiokuDB 0.12 Catalyst::Plugin::ConfigLoader 0.30 Catalyst::Plugin::Static::Simple 0.29 Catalyst::Runtime 5.80032 KiokuDB 0.52 KiokuDB::Backend::CouchDB 0.10