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 #29928 is a reply to message #29925] Tue, 30 November 2010 13:51 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1792
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

luzr wrote on Tue, 30 November 2010 13:21

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.



Have you tested in debug or release (Optimal)? Those numbers look quite high to me (for U++ allocator). In debug mode, U++ inserts a LOT of debugging info into the heap, so the consumption is higher.

(Will have to test myself... Smile


I tested with optimal and U++ allocator.
luzr wrote on Tue, 30 November 2010 13:25

Yes, only "very large" (> app. 64KB) memory blocks are returned to OS. Rest is kept for later reuse. Anyway, this behaviour is pretty typical for most allocators, only maybe some of them have different threshold.
This explains it. Smile SetCount() allocates all in one big block so it is returned, but Add() causes allocations of 1+2+4+8+...2^16B (that is up to 64KB) which are not returned (any further are bigger than 64KB and therefore returned). That should make ~128KB of non-returned blocks and that agrees exactly with what I measured for Vector<int>. For Vector<Value> it leaves more non-returned blocks probably because there are some additional allocations when constructing the Value...

Thanks for explanation,
Honza
 
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: Tue Aug 26 21:16:30 CEST 2025

Total time taken to generate the page: 0.05142 seconds