Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COActually, now that I re-read your post I my question stands still. After I use my bitmap, I will call dispose on it, so it actually will only take 8 bytes of memory. If in the other hand, I did not call dispose, well, then it really ocuppies 2mb of memory. There's the 3rd case of where there isn't a dispose method, so the GC can do nothing for it. So, the GC knowing the real size of the type will only help in situation 2. Or am I missing something?
      singulars
    2. COIn case 1, you will want to call GC.AddMemoryPressure on bitmap allocation and then GC.RemoveMemoryPressure when you manually release the bitmap. That will ensure that the object correctly reflects its size to the GC. However, if there is a way to be sure that the GC is never run while your object is eligible for collection and the bitmap is allocated, these methods might not matter.
      singulars
    3. COWell, in case one, I could do it, but it'd make no big difference, as the GC wouldn't be able to do a thing about my type, if I understand this correctly: 1) I'd declare my variable, 8 managed bytes, 2mb unmanaged bytes. I'd then use it, call dispose, so unmanaged memory is freed. Right now it will only ocuppy 8 bytes. Now, to my eyes, having called in the beggining AddMemoryPressure and RemoveMemoryPressure at the end wouldn't have made anything different. What am I getting wrong? Sorry for being so anoying about this.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload