memory grows when using flip geodesics shortening the same paths
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C++
- スター
- 1.3k
- フォーク
- 183
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nmwsharp/geometry-central のほかの issue
-
warning: control reaches end of non-void function in VectorHeatMethodSolver::computeLogMap対応中かも @dyollb が 63 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
nmwsharp/geometry-central#256 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
nmwsharp/geometry-central#258 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
nmwsharp/geometry-central#255 · コメント 1 件 ·
-
FlipEdgeNetwork::iterativeShorten() hangs on a contractible closed loop対応中かも @designbynumbers が 114 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
nmwsharp/geometry-central#253 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
nmwsharp/geometry-central#247 ·
nmwsharp/geometry-central の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
scanaislop/aislop#482 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
EchoTools/nevr-runtime#547 ·
メンテナーはふだん 1 日以内に返信
-
1 type: problem 2 scope: firmware 3 good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
SpaceTeam/STS1_COBC_SW#511 ·