POV-Ray : Newsgroups : povray.beta-test : leaks in alpha.9811560 Server Time
26 Dec 2024 21:24:00 EST (-0500)
  leaks in alpha.9811560 (Message 1 to 2 of 2)  
From: dick balaska
Subject: leaks in alpha.9811560
Date: 18 Sep 2018 21:10:17
Message: <5ba1a1f9$1@news.povray.org>
My povrayws (websockets) is leaking.  Actually, qtpovray leaks too, but
you have to run a ton of renders to notice it.

I knew about the argv setup leaks and thought I would tackle that mess.
(vfe/unix vfe/qt and vfe/websockets all share the same argv handling.
vfe/unix is a one-off render and who cares if it leaks. But, use that
method on a persistent object and drip drip drip.)

I was surprised to see my bad leaks actually come from POV-Ray.  Here's
four leak traces. Each one leaks per renderthread per render (so it's 8
blocks leaking because I ran +wt8. (2) runs of +wt2 leaks 4 blocks per)

pov::TracePixel::TracePixel (tracepixel.cpp:203)
pov::Ray::Ray (tracepixel.cpp:311)
pov::Trace::ComputeOneDiffuseLight (trace.cpp:1485)
pov::Trace::ComputeTextureColour (trace.cpp:450)

Hopefully these are still legible with the extreme line length wrappage.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==20508== 33,024 (256 direct, 32,768 indirect) bytes in 8 blocks are
definitely lost in loss record 10,278 of 10,291
==20508==    at 0x4C2E0EF: operator new(unsigned long) (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20508==    by 0x5D06F9: alloc (simplevector.h:640)
==20508==    by 0x5D06F9: PooledSimpleVector (simplevector.h:696)
==20508==    by 0x5D06F9:
pov::TracePixel::TracePixel(std::shared_ptr<pov::SceneData>, pov::Camera
const*, pov::TraceThreadData*, unsigned int, double, pov::QualityFlags
const&, pov::Trace::CooperateFunctor&, pov::Trace::MediaFunctor&,
pov::Trace::RadiosityFunctor&, bool) (tracepixel.cpp:203)
==20508==    by 0x64B1D4: pov::TraceTask::TraceTask(pov::ViewData*,
unsigned int, double, double, unsigned int,
std::shared_ptr<pov_base::GammaCurve>&, unsigned int, bool, bool, bool)
(tracetask.cpp:240)
==20508==    by 0x582EF6: pov::View::StartRender(POVMS_Object&)
(view.cpp:1135)
==20508==    by 0x576804:
pov::RenderBackend::StartRender(POVMS_Message&, POVMS_Message&, int)
(renderbackend.cpp:611)
==20508==    by 0x574A8B:
POVMS_MessageReceiver::ReceiveHandler(POVMSData*, POVMSData*, int,
void*) (povmscpp.cpp:1724)
==20508==    by 0x56CF15: POVMS_Receive(void*, POVMSData*, POVMSData*,
int) (povms.c:880)
==20508==    by 0x56F7A7: POVMS_ProcessMessages(void*, bool, bool)
(povms.c:610)
==20508==    by 0x4DBDF5: (anonymous
namespace)::MainThreadFunction(boost::function0<void> const&)
(povray.cpp:590)
==20508==    by 0x52695D4: ??? (in
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0)
==20508==    by 0x75516B9: start_thread (pthread_create.c:333)
==20508==    by 0x810F41C: clone (clone.S:109)
==20508==
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==20508== 33,024 (256 direct, 32,768 indirect) bytes in 8 blocks are
definitely lost in loss record 10,279 of 10,291
==20508==    at 0x4C2E0EF: operator new(unsigned long) (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20508==    by 0x5B5C84: alloc (simplevector.h:640)
==20508==    by 0x5B5C84: PooledSimpleVector (simplevector.h:696)
==20508==    by 0x5B5C84: pov::Ray::Ray(pov::TraceTicket&,
pov::Ray::RayType, bool, bool, bool, bool, bool) (ray.cpp:48)
==20508==    by 0x5CEE3D: pov::TracePixel::operator()(double, double,
double, double, pov_base::GenericRGBTColour<float>&) (tracepixel.cpp:311)
==20508==    by 0x64C2F1: pov::TraceTask::NonAdaptiveSupersamplingM1()
(tracetask.cpp:518)
==20508==    by 0x64D0BC: pov::TraceTask::Run() (tracetask.cpp:287)
==20508==    by 0x64D61F: pov::Task::TaskThread(boost::function0<void>
const&) (task.cpp:168)
==20508==    by 0x52695D4: ??? (in
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0)
==20508==    by 0x75516B9: start_thread (pthread_create.c:333)
==20508==    by 0x810F41C: clone (clone.S:109)
==20508==

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==20508== 33,024 (256 direct, 32,768 indirect) bytes in 8 blocks are
definitely lost in loss record 10,280 of 10,291
==20508==    at 0x4C2E0EF: operator new(unsigned long) (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20508==    by 0x5C5B53: alloc (simplevector.h:640)
==20508==    by 0x5C5B53: PooledSimpleVector (simplevector.h:700)
==20508==    by 0x5C5B53: Ray (ray.h:59)
==20508==    by 0x5C5B53:
pov::Trace::ComputeOneDiffuseLight(pov::LightSource const&,
pov::GenericVector3d<double> const&, pov::Finish_Struct const*,
pov::GenericVector3d<double> const&, pov::Ray const&,
pov::GenericVector3d<double> const&, pov_base::GenericColour<float>
const&, pov_base::GenericColour<float>&, double, pov::ObjectBase const*,
double, int) (trace.cpp:1625)
==20508==    by 0x5C5D1C:
pov::Trace::ComputeDiffuseLight(pov::Finish_Struct const*,
pov::GenericVector3d<double> const&, pov::Ray const&,
pov::GenericVector3d<double> const&, pov_base::GenericColour<float>
const&, pov_base::GenericColour<float>&, double, pov::ObjectBase*,
double) (trace.cpp:1485)
==20508==    by 0x5C90D2:
pov::Trace::ComputeLightedTexture(pov_base::GenericColour<float>&,
float&, pov::Texture_Struct const*, std::vector<pov::Texture_Struct
const*, std::allocator<pov::Texture_Struct const*> >&,
pov::GenericVector3d<double> const&, pov::GenericVector3d<double>
const&, pov::Ray&, float, pov::Intersection&) (trace.cpp:1010)
==20508==    by 0x5BC6E6:
pov::Trace::ComputeOneTextureColour(pov_base::GenericColour<float>&,
float&, pov::Texture_Struct const*, std::vector<pov::Texture_Struct
const*, std::allocator<pov::Texture_Struct const*> >&,
pov::GenericVector3d<double> const&, pov::GenericVector3d<double>
const&, pov::Ray&, float, pov::Intersection&, bool, bool) (trace.cpp:640)
==20508==    by 0x5BEEF5:
pov::Trace::ComputeTextureColour(pov::Intersection&,
pov_base::GenericColour<float>&, float&, pov::Ray&, float, bool)
(trace.cpp:554)
==20508==    by 0x5BFFD5: pov::Trace::TraceRay(pov::Ray&,
pov_base::GenericColour<float>&, float&, float, bool, double)
(trace.cpp:192)
==20508==    by 0x5CEEB5: pov::TracePixel::operator()(double, double,
double, double, pov_base::GenericRGBTColour<float>&) (tracepixel.cpp:318)
==20508==    by 0x64C2F1: pov::TraceTask::NonAdaptiveSupersamplingM1()
(tracetask.cpp:518)
==20508==    by 0x64D0BC: pov::TraceTask::Run() (tracetask.cpp:287)
==20508==    by 0x64D61F: pov::Task::TaskThread(boost::function0<void>
const&) (task.cpp:168)
==20508==    by 0x52695D4: ??? (in
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0)
==20508==

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==20508== 65,792 (256 direct, 65,536 indirect) bytes in 8 blocks are
definitely lost in loss record 10,285 of 10,291
==20508==    at 0x4C2E0EF: operator new(unsigned long) (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20508==    by 0x5BF676: alloc (simplevector.h:640)
==20508==    by 0x5BF676: PooledSimpleVector (simplevector.h:696)
==20508==    by 0x5BF676:
pov::Trace::ComputeTextureColour(pov::Intersection&,
pov_base::GenericColour<float>&, float&, pov::Ray&, float, bool)
(trace.cpp:450)
==20508==    by 0x5BFFD5: pov::Trace::TraceRay(pov::Ray&,
pov_base::GenericColour<float>&, float&, float, bool, double)
(trace.cpp:192)
==20508==    by 0x5CEEB5: pov::TracePixel::operator()(double, double,
double, double, pov_base::GenericRGBTColour<float>&) (tracepixel.cpp:318)
==20508==    by 0x64C2F1: pov::TraceTask::NonAdaptiveSupersamplingM1()
(tracetask.cpp:518)
==20508==    by 0x64D0BC: pov::TraceTask::Run() (tracetask.cpp:287)
==20508==    by 0x64D61F: pov::Task::TaskThread(boost::function0<void>
const&) (task.cpp:168)
==20508==    by 0x52695D4: ??? (in
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0)
==20508==    by 0x75516B9: start_thread (pthread_create.c:333)
==20508==    by 0x810F41C: clone (clone.S:109)


-- 
dik
Rendered 1024 of 921600 pixels (0%)


Post a reply to this message

From: clipka
Subject: Re: leaks in alpha.9811560
Date: 19 Sep 2018 05:53:54
Message: <5ba21cb2$1@news.povray.org>
Am 19.09.2018 um 03:10 schrieb dick balaska:

> Hopefully these are still legible with the extreme line length wrappage.

They're legible enough to recognize that they're all related to
PooledSimpleVector.

And indeed the class managing those vectors - VectorPool - doesn't have
a destructor. Duh.

Thanks for spotting this.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.