Home » U++ Library support » U++ Core » Value question (memory consumption)
Value question (memory consumption) [message #29906] |
Mon, 29 November 2010 11:31  |
Factor
Messages: 5 Registered: June 2007 Location: Hungary
|
Promising Member |
|
|
I've made a simple test with Vector<Value>:
#include <Core/Core.h>
using namespace UPP;
#define ITEM_COUNT 1000000
CONSOLE_APP_MAIN {
Vector<Value> v;
getchar();
for(int i=0;i<ITEM_COUNT;i++) v.Add((int)i);
getchar();
v.Clear(); v.Shrink();
getchar();
}
1. Adding ITEM_COUNT items (ints for simplicity) to Vector v raises the memory consumption of the process to ~20MB (Win XP - Task manager).
2. After clearing and shrinking Vector v the memory usage drops to 17MB.
As I saw the reference counting works as it should and the "delete *this;" (Void::Release) part of the inner Void class is called, still the memory usage of the process remains high.
I've tried to directly call the ~Value() destructor for all the Vector items before clear, but the result was the same.
Is this the normal behavior?
|
|
|
 |
|
Value question (memory consumption)
By: Factor on Mon, 29 November 2010 11:31
|
 |
|
Re: Value question (memory consumption)
|
 |
|
Re: Value question (memory consumption)
|
 |
|
Re: Value question (memory consumption)
By: unknown user on Mon, 29 November 2010 22:57
|
 |
|
Re: Value question (memory consumption)
By: mirek on Tue, 30 November 2010 13:21
|
 |
|
Re: Value question (memory consumption)
|
 |
|
Re: Value question (memory consumption)
By: mirek on Tue, 30 November 2010 14:26
|
 |
|
Re: Value question (memory consumption)
By: mirek on Tue, 30 November 2010 13:36
|
 |
|
Re: Value question (memory consumption)
By: mirek on Tue, 30 November 2010 14:46
|
 |
|
Re: Value question (memory consumption)
By: unknown user on Tue, 30 November 2010 16:48
|
 |
|
Re: Value question (memory consumption)
|
 |
|
Re: Value question (memory consumption)
By: mirek on Sat, 11 December 2010 10:38
|
 |
|
Re: Value question (memory consumption)
By: mr_ped on Tue, 30 November 2010 09:13
|
 |
|
Re: Value question (memory consumption)
By: mirek on Tue, 30 November 2010 13:25
|
Goto Forum:
Current Time: Sat Apr 26 21:51:07 CEST 2025
Total time taken to generate the page: 0.04421 seconds
|