Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Value question (memory consumption)
Value question (memory consumption) [message #29906] Mon, 29 November 2010 11:31 Go to previous message
Factor is currently offline  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?

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NEW: generic Toupel grouper
Next Topic: FIX: Value has Value, Value Type VALUE_V
Goto Forum:
  


Current Time: Thu May 09 20:53:26 CEST 2024

Total time taken to generate the page: 0.01157 seconds