Commit 0c1ef062 authored by Romain Pacanowski's avatar Romain Pacanowski

Tracing more precisely memory leaks

parent a39660f6
......@@ -10,6 +10,8 @@
#include "mrf/geometry/mesh.hpp"
#include "mrf/util/precision_timer.hpp"
#include "mrf/util/cpu_memory.hpp"
#include "tinyply/tinyply.h"
......@@ -136,6 +138,7 @@ inline void loadPLY( std::string const & ply_filename,
{
std::cout << " PLY FILENAME = " << ply_filename << std::endl;
std::cout << " BEGINNING of Load Tiny Ply . Available Memory " << mrf::util::CPUMemory::availableMemory() << " MB" << std::endl;
try
{
......@@ -182,8 +185,6 @@ inline void loadPLY( std::string const & ply_filename,
try
{
tiny_normals = file.request_properties_from_element("vertex", {"nx", "ny", "nz"});
}
catch (const std::exception &e)
{
......@@ -224,7 +225,16 @@ inline void loadPLY( std::string const & ply_filename,
tiny_color_per_vertex = nullptr;
}
mrf::util::PrecisionTimer read_timer;
read_timer.start();
file.read(ss);
read_timer.stop();
std::cout << "Ply file read in " << read_timer.elapsed() << " seconds " << std::endl;
std::cout << " AFTER read . Available Memory " << mrf::util::CPUMemory::availableMemory() << " MB" << std::endl;
read_timer.reset();
read_timer.start();
if (tiny_vertices)
std::cout << "\tRead vertices:" << tiny_vertices->count << std::endl;
......@@ -355,6 +365,11 @@ inline void loadPLY( std::string const & ply_filename,
color_per_vertex.resize(tiny_color_per_vertex->count);
std::memcpy((void *)color_per_vertex.data(), (const void *)tiny_color_per_vertex->buffer.get(), (size_t)num_tcpv_Bytes);
}
read_timer.stop();
std::cout << " Data Copied from PLY structures to vector in " << read_timer.elapsed() << std::endl;
read_timer.reset();
}
catch (const std::exception &e)
{
......@@ -362,6 +377,8 @@ inline void loadPLY( std::string const & ply_filename,
throw std::runtime_error("Caught tinyply exception");
}
std::cout << " End of Load Tiny Ply . Available Memory " << mrf::util::CPUMemory::availableMemory() << " MB" << std::endl;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment