Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 103317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:06:18+00:00 2026-05-11T01:06:18+00:00

I have a strange phenomenon while continuously instantiating a com-wrapper and then letting the

  • 0

I have a strange phenomenon while continuously instantiating a com-wrapper and then letting the GC collect it (not forced).

I’m testing this on .net cf on WinCE x86. Monitoring the performance with .net Compact framework remote monitor. Native memory is tracked with Windows CE Remote performance monitor from the platform builder toolkit.

During the first 1000 created instances every counter in perfmon seems ok:

  • GC heap goes up and down but the average remains the same
  • Pinned objects is 0
  • native memory keeps the same average
  • …

However, after those 1000 (approximately) the Pinned object counter goes up and never goes down in count ever again. The memory usage stays the same however.

I don’t know what conclusion to pull from this information… Is this a bug in the counters, is this a bug in my software?

[EDIT]

I do notice that the Pinned objects counter starts to go up as soon the total bytes in use after GC stabilises as does the Objects not moved by compactor counter.

The graphic of the counters http://files.stormenet.be/gc_pinnedobj.jpg

[/EDIT]

Here’s the involved code:

    private void pButton6_Click(object sender, EventArgs e) {         if (_running) {             _running = false;             return;         }         _loopcount = 0;         _running = true;          Thread d = new Thread(new ThreadStart(LoopRun));         d.Start();     }      private void LoopRun() {         while (_running) {             CreateInstances();             _loopcount++;             RefreshLabel();         }     }      void CreateInstances() {         List<Ppb.Drawing.Image> list = new List<Ppb.Drawing.Image>();         for (int i = 0; i < 10; i++) {             Ppb.Drawing.Image g = resourcesObj.someBitmap;             list.Add(g);         }      } 

The Image object contains an AlphaImage:

    public sealed class AlphaImage : IDisposable {     IImage _image;     Size _size;     IntPtr _bufferPtr;      public static AlphaImage CreateFromBuffer(byte[] buffer, long size) {         AlphaImage instance = new AlphaImage();         IImage img;         instance._bufferPtr = Marshal.AllocHGlobal((int)size);         Marshal.Copy(buffer, 0, instance._bufferPtr, (int)size);         GetIImagingFactory().CreateImageFromBuffer(instance._bufferPtr, (uint)size, BufferDisposalFlag.BufferDisposalFlagGlobalFree, out img);         instance.SetImage(img);         return instance;     }      void SetImage(IImage image) {         _image = image;         ImageInfo imgInfo;         _image.GetImageInfo(out imgInfo);         _size = new Size((int)imgInfo.Width, (int)imgInfo.Height);     }      ~AlphaImage() {         Dispose();     }      #region IDisposable Members      public void Dispose() {         Marshal.FinalReleaseComObject(_image);     } } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:06:19+00:00Added an answer on May 11, 2026 at 1:06 am

    I doubt it’s a bug in RPM. What we don’t have here is any insight into the Ppb.Drawing stuff. The place I see for a potential problem is the GetIImagingFactory call. What does it do? It’s probably just a singleton getter, but it’s something I’d chase.

    I also see an AllochHGlobal, but nowhere do I see that allocation getting freed. For now that’s where I’d focus.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 109k
  • Answers 109k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Mozilla does not set the global window.event property. I'd recommend… May 11, 2026 at 9:21 pm
  • Editorial Team
    Editorial Team added an answer Clear is a better option if you have a shared… May 11, 2026 at 9:21 pm
  • Editorial Team
    Editorial Team added an answer You can use ALTER TABLE to change the auto_increment initial… May 11, 2026 at 9:21 pm

Related Questions

I've built a self hosted wcf server, using wsHttpBinding . I'm running Win 2003
I have a strange requirement to ship an application without bundling .Net framework (to
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have a strange, sporadic issue. I have stored procedure that returns back 5

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.