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)
Re: Value question (memory consumption) [message #29930 is a reply to message #29916] Tue, 30 November 2010 14:46 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
andreincx wrote on Mon, 29 November 2010 16:57

Memory consumption is higher with U++ allocator. I've tested with USEMALLOC flag and the memory consumption was half, but has same behavior, only part of the memory is released.

I've modified example to do new allocations and seems that memory get back to OS, at least here on Linux, if i don't use U++ allocator.
#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();
	for(int i=0;i<ITEM_COUNT;i++) v.Add((int)i);
	getchar();
	v.Clear(); v.Shrink();
	getchar();
}


without U++ allocator:
292 KiB
38.4 MiB
30.8 MiB
38.8 MiB
420 KiB

with U++ allocator:
412 KiB
34.5 MiB (for a sec.) 70.2 MiB maybe Vector double amount of memory it need
62.5 MiB
70.2 MiB
62.5 MiB

Linux 2.6.35-23-generic #40-Ubuntu SMP Wed Nov 17 22:14:33 UTC 2010 x86_64 GNU/Linux

Andrei


My testing, Ubuntu64:

USEMALLOC:

256KB
38.4MB
30.8MB
38.4MB
384KB

U++ Allocator:

347KB
23.5MB
15.9MB
23.5MB
15.9MB

My bet is that you was testing in DEBUG mode...
 
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: Sun Apr 27 13:07:33 CEST 2025

Total time taken to generate the page: 0.00771 seconds