Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Memory leaks with BSTR

Memory leaks with BSTR

Scheduled Pinned Locked Moved ATL / WTL / STL
c++performancehelptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prasad_som
    wrote on last edited by
    #1

    Hi all, I'm facing a big problem with strings in ATL component. it need to append to same string in a function. that CComBSTR object is passed to a function by reference which appends some data to it. but in appending steps at certain stages it show increase in memory usages. Is this memory leak. how to work around this problem. thanks, Prasad

    2 1 Reply Last reply
    0
    • P prasad_som

      Hi all, I'm facing a big problem with strings in ATL component. it need to append to same string in a function. that CComBSTR object is passed to a function by reference which appends some data to it. but in appending steps at certain stages it show increase in memory usages. Is this memory leak. how to work around this problem. thanks, Prasad

      2 Offline
      2 Offline
      224917
      wrote on last edited by
      #2

      Can you specify how you determined memory usage has increased ? Also check whether this link has something to say.INFO :q139071
      There is no spoon. mail

      P 1 Reply Last reply
      0
      • 2 224917

        Can you specify how you determined memory usage has increased ? Also check whether this link has something to say.INFO :q139071
        There is no spoon. mail

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        in my component there is memory leak. when i was debugging application, i found in task manager that append statement of CComBSTR causes some increase in memory usage

        S 1 Reply Last reply
        0
        • P prasad_som

          in my component there is memory leak. when i was debugging application, i found in task manager that append statement of CComBSTR causes some increase in memory usage

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          I'm sure someone else will point this out... An increase in memory usage is not necessarily an indication that the program leaks memory. CComBSTR may use temporary heap space while it does the append operation. This may cause a change in the memory size of your app. When the memory is freed (via delete or free) this is not necessarily reflected immediately by the memory being marked as free from the OS point of view. If you do repeated appends (say, 1000 in a loop), and it still increases, that may be a better indication. Steve S Developer for hire

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups