This forum has been archived. All content is frozen. Please use KDE Discuss instead.

VectorXf resize(0) does not release memory

Tags: None
(comma "," separated)
sergejkarasov
Registered Member
Posts
1
Karma
0
Hello everybody,

I am quite new to Eigen so, I am doing maybe some trivial mistake but I have problem with freeing memory of VectorXf.
I am working on a Linux application which use VectorXf for storing seismic trace. I use VectorXf as class member and VectorXf is loaded with data in supplementary thread. The problem is that when I want to release memory by calling resize(0) VectorXf member function in main thread, the vector size is set to 0, however it seems that the memory isn't actually released to the system (I was checking the process explorer and the memory attached to the process has not changed).
Do you have any idea what could cause such a behaviour?

Thanks, Sergej.

P.S. I call Eigen::initParallel() during initialization of the application.
zhanxw
Registered Member
Posts
17
Karma
0
Just curious why you think resize() will release memory.
Is there somewhere in the Eigen doc mentions that?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Calling .resize(0) does free the memory through a call to system's free() function. The fact you don't see it in your monitor is because the system chose to reserve this chunk to your app.... but don't worry it is really freed.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient