473,809 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

lots of GDI objects

Hi,

i'm experiencing a very weird problem here.
I've got a ListView, 4 columns and about 300 items. Nothing to worry about
there.
Now when I scroll up and down repeatedly using the vertical scrollbar, I see
the number of GDI object grow rapidly. Now and then it drops again to about
60 which is reasonable.When this number reaches 10.000, all of a sudden, it
turns into 4.294.964.397 (more or less).
Running the garbage collector manually does not help anymore then.
I also noticed that when I run the garbage collector (manually) *before* the
number reaches 10.000 this problem does not occur.
What is going wrong here ? I'm not doing any custom drawing, I don't even
use another backcolor, font or whatever. Why does it allocate so many GDI
objects. If I wrote something like a ListView, I would cache some or all of
the pens and brushes, as in most cases all the rows have similar properties
(color, font, ...).

I must be missing something. Anybody a clue ?
Thanks in advance.
Greetings,
Bram.
Nov 16 '05 #1
10 3494
> i'm experiencing a very weird problem here.
I've got a ListView, 4 columns and about 300 items. Nothing to worry about there.


Which tool are you using to determine the number of GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk

Nov 16 '05 #2
Hi,

I'm using the task manager. Is it that inaccurate ?

Regards,

Bram.
"codymanix" <no************ ****@gmx.net> wrote in message
news:uQ******** ******@TK2MSFTN GP11.phx.gbl...
i'm experiencing a very weird problem here.
I've got a ListView, 4 columns and about 300 items. Nothing to worry

about
there.


Which tool are you using to determine the number of GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk

Nov 16 '05 #3
> I'm using the task manager. Is it that inaccurate ?
No I was just curious. But how can you be sure they are GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Nov 16 '05 #4
> I'm using the task manager. Is it that inaccurate ?
No I was just curious. But how can you be sure they are GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Nov 16 '05 #5
Hi,

There's a GDI Objects column for every process in task manager, I suppose
they are what they are.
Never seen anything wrong when there was nothing wrong.
Over years I have found these numbers very accurate. Why shouldn't they not
be.
I suppose there might be a small bug in Task Manager, or in some kernel
function causing the number to go insane when it passes 10.000. Which
doesn't mean there is actually going something wrong in the GDI system.

But this doesn't explain why my listview is rapidly allocating so many gdi
objects while scrolling.

Cheears,

Bram

"codymanix" <no************ ****@gmx.net> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
I'm using the task manager. Is it that inaccurate ?

No I was just curious. But how can you be sure they are GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk

Nov 16 '05 #6
Hello,

I experienced the same problem but on a VB6 application, I guess that
internally no real sharing of resources is made, the thing is that the
applications crashes when reaches 10.000 GDI objects... That's why I like
most Visual C++...

Best regards,
Relu.

"Bram" <bv*****@nospam .skynet.be> wrote in message
news:40******** **************@ news.skynet.be. ..
Hi,

i'm experiencing a very weird problem here.
I've got a ListView, 4 columns and about 300 items. Nothing to worry about there.
Now when I scroll up and down repeatedly using the vertical scrollbar, I see the number of GDI object grow rapidly. Now and then it drops again to about 60 which is reasonable.When this number reaches 10.000, all of a sudden, it turns into 4.294.964.397 (more or less).
Running the garbage collector manually does not help anymore then.
I also noticed that when I run the garbage collector (manually) *before* the number reaches 10.000 this problem does not occur.
What is going wrong here ? I'm not doing any custom drawing, I don't even
use another backcolor, font or whatever. Why does it allocate so many GDI
objects. If I wrote something like a ListView, I would cache some or all of the pens and brushes, as in most cases all the rows have similar properties (color, font, ...).

I must be missing something. Anybody a clue ?
Thanks in advance.
Greetings,
Bram.

Nov 16 '05 #7
Hi,

There's a GDI Objects column for every process in task manager, I suppose
they are what they are.
Never seen anything wrong when there was nothing wrong.
Over years I have found these numbers very accurate. Why shouldn't they not
be.
I suppose there might be a small bug in Task Manager, or in some kernel
function causing the number to go insane when it passes 10.000. Which
doesn't mean there is actually going something wrong in the GDI system.

But this doesn't explain why my listview is rapidly allocating so many gdi
objects while scrolling.

Cheears,

Bram

"codymanix" <no************ ****@gmx.net> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
I'm using the task manager. Is it that inaccurate ?

No I was just curious. But how can you be sure they are GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk

Nov 16 '05 #8
Hello,

I experienced the same problem but on a VB6 application, I guess that
internally no real sharing of resources is made, the thing is that the
applications crashes when reaches 10.000 GDI objects... That's why I like
most Visual C++...

Best regards,
Relu.

"Bram" <bv*****@nospam .skynet.be> wrote in message
news:40******** **************@ news.skynet.be. ..
Hi,

i'm experiencing a very weird problem here.
I've got a ListView, 4 columns and about 300 items. Nothing to worry about there.
Now when I scroll up and down repeatedly using the vertical scrollbar, I see the number of GDI object grow rapidly. Now and then it drops again to about 60 which is reasonable.When this number reaches 10.000, all of a sudden, it turns into 4.294.964.397 (more or less).
Running the garbage collector manually does not help anymore then.
I also noticed that when I run the garbage collector (manually) *before* the number reaches 10.000 this problem does not occur.
What is going wrong here ? I'm not doing any custom drawing, I don't even
use another backcolor, font or whatever. Why does it allocate so many GDI
objects. If I wrote something like a ListView, I would cache some or all of the pens and brushes, as in most cases all the rows have similar properties (color, font, ...).

I must be missing something. Anybody a clue ?
Thanks in advance.
Greetings,
Bram.

Nov 16 '05 #9
There's a known bug in the performance counter object for GDI handles (which
is used by taskman), once the max value (10000)is exceeded it returns a
bogus number.

Willy.
"Bram" <bv*****@nospam .skynet.be> wrote in message
news:40******** **************@ news.skynet.be. ..
Hi,

There's a GDI Objects column for every process in task manager, I suppose
they are what they are.
Never seen anything wrong when there was nothing wrong.
Over years I have found these numbers very accurate. Why shouldn't they
not
be.
I suppose there might be a small bug in Task Manager, or in some kernel
function causing the number to go insane when it passes 10.000. Which
doesn't mean there is actually going something wrong in the GDI system.

But this doesn't explain why my listview is rapidly allocating so many gdi
objects while scrolling.

Cheears,

Bram

"codymanix" <no************ ****@gmx.net> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
> I'm using the task manager. Is it that inaccurate ?

No I was just curious. But how can you be sure they are GDI objects?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk


Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1094
by: Mickel Grönroos | last post by:
Hi everybody, This is a question about Tkinter.Canvases and performance: I am writing a Tkinter application that among other things contains a number of Tkinter.Canvases that in turn hold rectangle and text objects that can be moved along with clicking and dragging the mouse. Everything works fine and well when I have just a few of these objects on the canvases, but when the number of objects on the canvases grow over a thousand, the...
10
1786
by: AlexS | last post by:
Hi, I wonder if anybody can comment if what I see is normal in FW 1.1 and how to avoid this. I have .Net assembly, which creates literally thousands of temporary strings and other objects when running. Usually it is something like { string s=some value; some local processing here
5
1419
by: Simon | last post by:
Hi all, I'm hoping that someone could help with the following general question: I'm making a website that manages beta releases of software. It does various things like store bugs, comments, work arounds and feature requests. Users can subscribe to be notified if a feature or bug is detected in their area of interest. The software developer can publish new and polls and all sorts of crap like
18
3063
by: Matthias Kaeppler | last post by:
Hi, in my program, I have to sort containers of objects which can be 2000 items big in some cases. Since STL containers are based around copying and since I need to sort these containers quite frequently, I thought it'd be a better idea to manage additional containers which are initialized with pointers to the objects in the primary containers and sort those (only pointers have to be copied around then). However, that also means if I...
2
2011
by: Chris | last post by:
Hi, I am building a single webform/webpage asp.net application using VB.NET. I have created lots of classes for this web application. On page load I use a facade controller pattern class to perform all my initial class object instaniations using sub new() procedures I'm using this project to learn the ins and outs of OOA and OOD, so instead of doing everything in code behind pages I have lots of objects now created
8
1952
by: vvenk | last post by:
Hello: I just wrote my first ASP.Net application. It worked fine on my machine and when I put into production, the ASP.Net process reaches 50% quite fast and then the system does not work anymore until I kill that process. Obviously, this is not acceptable. Looking back, I do not destroy any objects in my form. Would that be the reasn why the application breaks down?
2
46999
by: wlevine | last post by:
Can someone give me an example of how to construct an array of objects? for example, I have: function objFacility(id,name,adr,city,state,zip) { this.id = id this.name=name this.adr=adr this.city=city this.state=state this.zip=zip
8
1942
by: rpsetzer | last post by:
I have to create a big web application and I was thinking of using a data layer. For each entity in the database, I'll define a class that maps the table structure, having sub-objects for each foreign key, having insert/delete/update methods, the usual deal. Yet, I am very concerned about performance. For example, there are lots of cases when I may just be needing the employee name. Yet using this model, I will have to instantiate an...
10
9090
by: Tigger | last post by:
I have a method that is passed two objects and it needs to return an object that represents those two objects multiplied together. public object Multiply(object a, object b) { return a * b; } The objects can be any type of number and I would like it to do the maths in the most efficient and accurate way.
12
3606
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a gridview, for example, I loop through a datareader, populating an array list with instances of a custom class in the middle tier, and then send the array list up to the presentation layer and bind the gridview to it. If I use a typed dataset, I...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.