Question

How can I automatically flush out GDI objects?

Asked by: avsc

hello, I have a client that has an issue with ActSage.exe crashing on client computers when GDI reaches 10,000 objects.  Short of killing the process ActSage.exe and restarting  the program is there any other way i can flush out the GDI objects to prevent Act from crashing?

The probles seems to stem from a .net 2.0 running on XP SP3.  There is a patch for the issue on XP SP2 but is will not install on XP SP3.

Here is some additonal reference about the issue as it was explained to me.

There is a bug in Microsofts .NET 2.0 program which causes a memory leak (specifically of the GDI objects).  When you google the bufferindex error, you can get to sites that talk about it.  ACT uses .NET 2.0 to run, which is why you see these errors in ACT.  If you had any other program that also uses .NET 2.0, you would see these same errors in that program over time.  Here is a screen capture of the GDI objects from your machine when ACT gives that error.  Once the GDI objects get to almost 10,000, it crashes:

 

The memory leak is specific around the graphical interface  in other words, the more you move around and do stuff in ACT, the more graphical images are stored and then, at some point, it maxes out and you see the errors.  Linda, you could watch this happen by keeping your task manager open as you navigate around ACT and watch the GDI number climb.  When the GDI number gets close to 10,000, ACT will crash.

Microsoft developed a hotfix to correct this issue.

Microsoft also included that hotfix in their SP3 (Service Pack 3) release.  You are on Service Pack 3.  The bad news is that the hotfix doesnt work in the SP3 release.  We tried to apply the hotfix separately but that wasnt possible as the hotfix first looked at your system and said, nope, dont need to install the hotfix as you already have it as part of SP3.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-12 at 16:19:07ID24648400
Tags

ACT

Topics

ACT

,

Microsoft Operating Systems

Participating Experts
2
Points
500
Comments
27

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. GDI memory leaks when using Palettes in Metafiles
    BoundsChecker throws up a memory leak error in GDI when using the following code HDC m_hrefdc, m_hmfdc; HPALETTE hpal, psel; RECT m_refrect; m_hrefdc = CreateDC("DISPLAY", NULL, NULL, NULL); m_hmfdc = CreateEnhMetaFile(m_hrefdc, NULL, &m_refrect, "T...
  2. GDI Resource Leak
    The following code causes a memory leak in my app HBITMAP m_hLogoBMP = LoadBitmap( _Module.m_hInst, MAKEINTRESOURCE( IDB_GENDAC ) ); if( m_hLogoBMP == NULL ) return false; HDC m_hLogoDC = CreateCompatibleDC( NULL ); SelectObject( m_hLogoDC, m_hLogoBMP ); BitBlt( GetD...
  3. GDI leak?
    Hi, I use this code under Windows 2000: HBRUSH hBrushTest; hBrushTest = CreateSolidBrush( RGB(0,0,0) ); DeleteObject( hBrushTest ); After the creation of the brush, the GDI count in the task manager (when you show that column) increases by one. Unfortunately, the count doe...
  4. Drawing using GDI and memory leak
    I am drawing a colection of objects on the screen using windows GDI. these objects are updated after a certain time has elapsed using the WM_TIMER message. Now the application runs fine for a while but after sometimes the drawing disappears and the PC almost hangs. I have del...
  5. MemoryStream/GDI issue
    I've been getting a byte array (via WebClient.DownloadData), and creating an image from the data using the following code: System.Drawing.Bitmap bmpPic; bmpPic = System.Drawing.Bitmap.FromStream(New IO.MemoryStream(bImage)); 'GDI processing... I then take the bitmap and, de...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ComputerTechiePosted on 2009-08-12 at 16:29:52ID: 25084167

What happen if you update the dot net to 3.5; have you tried this ?

CT

 

by: GLComputingPosted on 2009-08-12 at 19:29:39ID: 25085111

What version of ACT!?
Full build from Help | About

 

by: avscPosted on 2009-08-13 at 17:58:03ID: 25094528

.Net 3.5 SP1 did not help.  The ACT consultant says the issue is with Windows XP on SP3. Updating to .Net 3.5 SP1 will not help and it has not.

It is ACT9

 

by: GLComputingPosted on 2009-08-13 at 18:56:30ID: 25094744

What build of ACT!9 - from Help | About?

BTW" You didn't post the screen shot from your original post

 

by: avscPosted on 2009-08-13 at 19:16:13ID: 25094820

ACT! by Sage Premium 2009 (11.0) Version 11.1.183.0, Hotfix 1

What screenshot?

 

by: GLComputingPosted on 2009-08-13 at 20:18:51ID: 25095029

"Here is a screen capture of the GDI objects from your machine when ACT gives that error. "

 

by: avscPosted on 2009-08-13 at 20:31:51ID: 25095081

here you go.  Just shows task manager with GDI column.

 

by: avscPosted on 2009-08-13 at 20:32:44ID: 25095083

ACT Consultant says Act crashes when GID objects reach 10k

 

by: GLComputingPosted on 2009-08-13 at 22:52:22ID: 25095506

Interesting.... I can't get mine above 2000, but I'm on Vista.

I'll try an install with XP sp3 and see if I can replicate it.

BTW: Which consultant have you been talking to?

 

by: avscPosted on 2009-08-13 at 22:58:12ID: 25095519

Power of three po3inc.com

 

by: GLComputingPosted on 2009-08-13 at 23:04:22ID: 25095546

I've dug a bit more deeply.

This is the patch you re referring to - http://support.microsoft.com/?kbid=319740
I'd be interested in hearing what MS might say if asked about that patch for SP3?

It also only seems to be a problem on some databases and some times... it seems quite inconsistent from the testing I've done and reports I've seen

 

by: GLComputingPosted on 2009-08-13 at 23:19:26ID: 25095606

There is also a default per-process limit of GDI handles. To change this  limit, set the following registry  value:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows  NT\CurrentVersion\Windows\GDIProcessHandleQuota

I think the default is 0x2704 (Hex), which is 9,988 in decimal that you see in the task manager. You might want to click the "Decimal" box when making a change to increase it

This value can be set  to a number between 256 and 65,536 (Decimal)

This won't  solve the problem it just kinda hides it...


Have a look at http://kb.sagesoftwareonline.com/cgi-bin/sagesoftwareonline.cfg/php/enduser/std_adp.php?p_faqid=17414

 

by: avscPosted on 2009-08-13 at 23:44:48ID: 25095674

Good stuff GLComputing.  I will do a test on one of my problem users and crank up the GDI handles to 30k and see if that "hides" the problem well enough.  A couple users on XP SP3 are crashing ACT several times a day and very frustrated.  Stay tuned!

 

by: GLComputingPosted on 2009-08-14 at 00:17:23ID: 25095780

Hopefully it will delay the issue long enough for a day's work

If you speak to Stacey, tell her Hi from Mike Lazarus :-)

 

by: avscPosted on 2009-08-17 at 18:43:10ID: 25119649

Changing the GLI Handles to 30k did not help.  I tried to contact Microsoft concerning this but am having trouble submitting a business trouble ticket as I am only a registered parter not yet certified.  Funny I never had this problem when contacting MS on a server problem. Anyway I have this nice summary of the problem I was ready to submit to Microsoft.  

Any other help would be appreciated.

Here is my summary of the problem:

My client is running Windows XP Professional SP3 and is having trouble with  ACT! by Sage Premium 2009 (11.0) Version 11.1.183.0, Hotfix 1 working with Office 2003.

ACT! Randomly crashes several times per day with the following error, it also crashes when trying to use the ACT! feature Attaching Emails to Contacts in ACT! 2009 where if you click on an email contact in ACT! It will open a email composer in Outlook and add the content of the email to the ACT! Customer record. The issue is only present on computers running XP SP3. Older computers on XP SP2 are not having this issue.

Error: Act! Has encountered an error. Please shut down the program.

The ACT! Consultant has indicated that there is a bug in .NET 2.0 which is causing a problem and there is a Microsoft hot fix to address the issue, however the hotfix only works on XP SP2.  Not XP SP3.  Here is the consultants explanation;

I wanted to send you an email with an explanation of the root cause of all of the error messages you have been seeing.  Even though you see them in ACT, they are not really because of ACT.  Ill try to avoid all of the techno mumbo-jumbo in this explanation&

There is a bug in Microsofts .NET 2.0 program which causes a memory leak (specifically of the GDI objects).  When you google the bufferindex error, you can get to sites that talk about it.  ACT uses .NET 2.0 to run, which is why you see these errors in ACT.  If you had any other program that also uses .NET 2.0, you would see these same errors in that program over time.  Here is a screen capture of the GDI objects from your machine when ACT gives that error.  Once the GDI objects get to almost 10,000, it crashes:

 

The memory leak is specific around the graphical interface  in other words, the more you move around and do stuff in ACT, the more graphical images are stored and then, at some point, it maxes out and you see the errors.  Linda, you could watch this happen by keeping your task manager open as you navigate around ACT and watch the GDI number climb.  When the GDI number gets close to 10,000, ACT will crash.

Microsoft developed a hotfix to correct this issue.

Microsoft also included that hotfix in their SP3 (Service Pack 3) release.  You are on Service Pack 3.  The bad news is that the hotfix doesnt work in the SP3 release.  We tried to apply the hotfix separately but that wasnt possible as the hotfix first looked at your system and said, nope, dont need to install the hotfix as you already have it as part of SP3.


I have tried the following to resolve the issue.  

Task: upgraded Lindas computer to use  .NET 3.3 SP1.

Errors persist

 Increased the GDI Objects.  Using Linda as test I increased the GDI objects from 10000 to 30000.  I also un-installed the .net 3.5 sp1 reverting back to .net 2.0.

Error: An error occurred while attempting to connect to home text/html. Please try again.

Error: ACT! By Sage has encountered a problem and needs to close. We are sorry for the inconvenience.

The ACT! Consultant gives the following as options.  I am seeking assistance from Microsoft on this issues to find a better solution that reverting back to XP SP2.

The options are:
-          Continue as you have been and when ACT creates the error, close it (which frees up the GDI objects) and then re-open it.
-          Do a complete reinstall of Windows XP up to SP2.  Then apply the hotfix rather than SP3.


 

by: GLComputingPosted on 2009-08-18 at 00:49:25ID: 25120798

I've run it for ages with SP3, so it's not completely SP3.

Also, if sending the abover to Microsoft, you should include the link to their KB telling them about the Hotfix (I posted that above).

The other thing I'd try is to uninstall ACT!, uninstall SQL, uninstall and clean out .Net (all versions). Then reinstall .Net, re-boot, and finally reinstall ACT! again and any patches/hotfix.

This will fix a lot of .Net related issues

 

by: avscPosted on 2009-08-19 at 11:25:44ID: 25135713

Microsoft's answer was to roll back to XP SP2.  I am giving that a try.  Then I will try what you suguest above.

 

by: GLComputingPosted on 2009-08-22 at 00:24:11ID: 25157738

BTW: When you bumped up the GDI, did it still crash at 10,000 or did it last longer?

 

by: avscPosted on 2009-08-22 at 00:55:14ID: 25157830

I am going to try what you recomended.   Should I apply SP3 or just patch XP SP2 less SP3?


"The other thing I'd try is to uninstall ACT!, uninstall SQL, uninstall and clean out .Net (all versions). Then reinstall .Net, re-boot, and finally reinstall ACT! again and any patches/hotfix.

This will fix a lot of .Net related issues"



 

by: GLComputingPosted on 2009-08-22 at 00:57:28ID: 25157838

I've found SP3 fine, but there are quite a few who seem to find it less stable than sp2... so, it's up to you if you want to try it after getting it working with sp2

 

by: avscPosted on 2009-09-21 at 16:41:01ID: 25388689

Update: Unable to find a fix for this.  Rolling back SP3 to SP2 helps some.

 

by: GLComputingPosted on 2009-09-21 at 20:05:38ID: 25389301

It could also be a damaged .Net.

This is a procedure I wrote to get the most clean install possible:
Uninstall any version of ACT! from Windows Control Panel | Add/Remove Programs
Download and run the Uninstaller.exe from the ACT! KB 19338 (the exe, not the manual uninstall)
Uninstall .Net Framework (all versions) - this does NOT apply to Vista users as .Net 2.0 is part of the OS and can't be uninstalled
Use this tool to fully remove .Net - http://blogs.msdn.com/astebner/archive/2006/05/30/611355.aspx

Uninstall any MS SQL items from the Control Panel if still there
Uninstall MSXML 6 Services from Control Panel if it's still there
Perform a Selective restart with MSCONFIG as per ACT! KB 14499
Install .Net 3.5 Framework (only 2.0 for ACT! 9/10/11) as per KB 19628  (only XP, not Vista)
Reboot after installing .Net before installing ACT!
Install ACT! full install
Install latest ACT! patch if the previous install was a previous build and then any Hotfix
Check task manager to make sure .Net optimisation is finished (look for the setup, msiexec or ngen) - might take up to 10 minutes
Restore from Selective Startup Mode with MSCONFIG
Reboot

Takes time, but will give the cleanest and most stable install.

For the KB numbers, go here http://tinyurl.com/34xq94 - put the number in "Search Text" and change "Search By" to Answer ID

 

by: avscPosted on 2009-09-21 at 20:19:24ID: 25389326

Okay, I will revisit the issue with this new information.  Thank you

 

by: GLComputingPosted on 2009-09-21 at 21:12:04ID: 25389428

I've founf the .Net cleanup tool can help with a lot of systems with "strange" issues.

Please post back when you've had the chance to try it

 

by: GLComputingPosted on 2009-09-27 at 14:09:59ID: 25435508

Avsc was testing the solution.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...