[dancer-users] potential memory leak?
ZahirLalani at oliver.agency
Thu Mar 21 13:30:32 GMT 2019
We have a weird issue and suspect its possibly a memory leak. I need some guidance as to how to debug this and solve it.
We use Dancer2 and Starman, fronted by Apache
We have an image gallery where the user can browse images based on a variety of criteria. The gallery is page driven, and the user navigates using previous/next buttons. Each page displays 36 images.
Although starman handles all routes, it does not handle the delivery of the images. We use an apache module called xsend which offloads the delivery to apache and allows starman to focus on data queries.
We find that for certain clients who use the gallery heavily, after many page navigations some of the images on the page cause 302's and loses the session, so the user has to login again. We can run the image route in another browser session and its fine.
The "break" does not happen at a consistent place.
The code that does xsend relies on "halt" as follows:
# do the queries to get the image details and physical path
# now make the xsend request:
header('Content-Type' => $mime);
header("X-Sendfile" => $file);
header('Content-Disposition' => "inline; filename=\"".encode_utf8($file_name)."\";");
debug('halting for xsend');
This method is called through multiple code layers. From what I can tell, halt replace return, but it also says that it stops processing at the point of halt. We have been looking through logs and cannot see anything specific apart from the 302's and loss of session.
Any guidance on how to proceed with this would be much appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dancer-users