memory grows when using flip geodesics shortening the same paths
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- computer-graphics, performance
Línea de trabajo
Reproduce the repeated calls in the provided C++ program, starting with geometrycentral/surface/flip_geodesics.h and the FlipEdgeNetwork calls reinitializePath(), iterativeShorten(), and rewind(). Track resident memory across repeated runs and inspect the lifecycle of those operations. Done means repeated shortening of the same path no longer causes unexplained memory growth.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When I follow the official documentation to call the flip geodesics algorithm multiple times on the same dataset, the memory usage keeps growing.
Shortening many paths,doc: https://geometry-central.net/surface/algorithms/flip_geodesics/
I'm a C++ beginner, and with the help of the documentation and ChatGPT, I wrote the following program:
#include <fstream>
#include <vector>
#include <chrono>
#include "geometrycentral/surface/flip_geodesics.h"
#include "geometrycentral/surface/vertex_position_geometry.h"
#include "geometrycentral/surface/meshio.h"
#include "geometrycentral/surface/mesh_graph_algorithms.h"
#include <mach/mach.h>
#include <iostream>
#include <mach/task.h>
#include <mach/mach_init.h>
#include <libproc.h> // for proc_pidinfo() on some macOS versions
#include <sys/types.h> // for pid_t
#include <unistd.h> // for getpid() and getrusage()
#include <sys/resource.h> // for getrusage()
using namespace geometrycentral;
using namespace geometrycentral::surface;
int computeFlipGeodesicPath(
std::unique_ptr<FlipEdgeNetwork> &edgeNetwork,
int vertex0,
int vertex1)
{
Vertex startVert = edgeNetwork->tri->intrinsicMesh->vertex(vertex0); // populate these somehow
Vertex endVert = edgeNetwork->tri->intrinsicMesh->vertex(vertex1);
// Get an initial dijkstra path
// (surface/mesh_graph_algorithms.h)
std::vector<Halfedge> dijkstraPath = shortestEdgePath(*edgeNetwork->tri, startVert, endVert);
// Reinitialize the ede network to contain this path
edgeNetwork->reinitializePath({dijkstraPath});
// Straighten the path to geodesic
edgeNetwork->iterativeShorten();
// Extract the path and store it in the vector
// std::vector<Vector3> path3D = edgeNetwork->getPathPolyline3D().front();
// Be kind, rewind
edgeNetwork->rewind();
return 1;
}
int main()
{
using namespace std::chrono;
std::unique_ptr<ManifoldSurfaceMesh> mesh;
std::unique_ptr<VertexPositionGeometry> geom;
std::tie(mesh, geom) = readManifoldSurfaceMesh("/Downloads/test.obj");
std::unique_ptr<FlipEdgeNetwork> edgeNetwork(new FlipEdgeNetwork(*mesh, *geom, {}));
edgeNetwork->supportRewinding = true;
edgeNetwork->posGeom = geom.get();
struct task_basic_info t_info;
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
// 1
computeFlipGeodesicPath(edgeNetwork, 36841, 29806);
if (KERN_SUCCESS != task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count))
{
std::cerr << "task_info() failed" << std::endl;
return 1;
}
std::cout << "Resident Memory Size: " << t_info.resident_size / 1024 / 1024 << " MB" << std::endl;
// 2
computeFlipGeodesicPath(edgeNetwork, 36841, 29806);
if (KERN_SUCCESS != task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count))
{
std::cerr << "task_info() failed" << std::endl;
return 1;
}
std::cout << "Resident Memory Size: " << t_info.resident_size / 1024 / 1024 << " MB" << std::endl;
// 3
computeFlipGeodesicPath(edgeNetwork, 36841, 29806);
if (KERN_SUCCESS != task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count))
{
std::cerr << "task_info() failed" << std::endl;
return 1;
}
std::cout << "Resident Memory Size: " << t_info.resident_size / 1024 / 1024 << " MB" << std::endl;
return 0;
}
result:
obj file:
test.obj.zip
- Lenguaje dominante
- C++
- Estrellas
- 1.3k
- Forks
- 183
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nmwsharp/geometry-central
-
warning: control reaches end of non-void function in VectorHeatMethodSolver::computeLogMapPosiblemente ocupada @dyollb la tomó hace 65 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
nmwsharp/geometry-central#256 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
nmwsharp/geometry-central#258 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
nmwsharp/geometry-central#255 · 1 comentario ·
-
FlipEdgeNetwork::iterativeShorten() hangs on a contractible closed loopPosiblemente ocupada @designbynumbers la tomó hace 116 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
nmwsharp/geometry-central#253 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
nmwsharp/geometry-central#247 ·
Todos los issues de nmwsharp/geometry-central
Issues similares
-
bug core p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
FriendsofECCE/ECCE#336 · 1 comentario ·
-
Real literal with a 'd' exponent and a kind suffix (1.0d0_4) is accepted; the suffix is ignoredAbiertoerror not reported low priority semantics
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
bitcoin-core/gui-qml#1030 ·
Los mantenedores suelen responder en 3 días