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 » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl Display memory usage
ArrayCtrl Display memory usage [message #43976] Fri, 05 December 2014 09:18 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I have been using the Display classes of U++ extensively to color rows in my ArrayCtrl. However, I am experiencing excessive memory usage when I keep setting the Display of a row/cells continuously. The memory is growing very fast. I thought only a pointer to the Display class is saved. Am I wrong? Is there a way to replace/clear the Display before resetting it? Maybe there even is an error in the code I am using:

void CrySearchArrayCtrl::SetRowDisplay(int i, const Display& d)
{
	const int rowCount = this->GetCount();
	const int colCount = this->GetColumnCount();
	if(i >= 0 && i < rowCount)
	{
		for (int j = 0 ; j < colCount; ++j)
		{
			this->cellinfo.At(i).At(j).Set(d);
		}
	}
	
	this->RefreshRow(i);
}


Thanks a lot!

crydev
Re: ArrayCtrl Display memory usage [message #44135 is a reply to message #43976] Fri, 02 January 2015 16:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Only pointer is stored. Memory usage could be very slightly bigger (because the whole array is not used if there are no displays set), but 10-30 bytes/cell max.

I would say problem is somewhere else or more complicated. If you could post a testcase eating a lot of memory, I could investigate...

Mirek
Re: ArrayCtrl Display memory usage [message #44589 is a reply to message #44135] Wed, 08 April 2015 09:24 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thank you for your reply Mirek,

I also thought that the pointer was the only thing that was stored so that is why I was confused. The problem appeared to be something else, which I don't know the exact cause of. Recently I've been greatly reducing the amount of memory my application uses from different points of view. This issue is solved. Smile

Thank you!
Previous Topic: Virtual arrays and buttons.
Next Topic: How to change column's name in ArrayCtrl
Goto Forum:
  


Current Time: Wed Nov 20 20:57:17 CET 2019

Total time taken to generate the page: 0.01262 seconds