Program memory Issue?

G

Guest

I have a program using VB express where I have about 50 forms through out the
program on various forms I have multiple BMP pictures on the form, when I
went to create a new form and put about 6 bmp pictures on it,it gave me a
error saying I did not have enough memory. Is there a limit? why is it doing
this?
Thanks,
Jerry
 
M

Michael Nemtsev

Hello jerry,

The memory in .NET world is fragmented. Each time your app needs some memory
it's assigned in blocks of 16/35mb by FW.
While your app works your can perform some memory allocation which is pinned,
GCed and etc, and once you can end up with the situation when you have 1GB
free time

---
WBR, Michael Nemtsev [C# MVP].
[.Net Tips & Tricks]: http://msmvps.com/blogs/laflour/pages/net-tips-amp-tricks.aspx
My blog: http://spaces.live.com/laflour/ Team blog: http://devkids.blogspot.com/


"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

j> I have a program using VB express where I have about 50 forms through
j> out the
j> program on various forms I have multiple BMP pictures on the form,
j> when I
j> went to create a new form and put about 6 bmp pictures on it,it gave
j> me a
j> error saying I did not have enough memory. Is there a limit? why is
j> it doing
j> this?
j> Thanks,
j> Jerry
 
M

Michael Nemtsev

Hello Michael ,

Damn, pressed "send" accidentally.
Well... returning to my previous post....

MN> The memory in .NET world is fragmented. Each time your app needs
MN> some memory it's assigned in blocks of 16/35mb by FW. While your app
MN> works your can perform some memory allocation which is pinned, GCed
MN> and etc, and once you can end up with the situation when you have
MN> 1GB free time

u have 1GB free, but your memory is highly fragmented. Albeit the GC can
mitigate this, moving "managed" block a little, the LOH part of memory is
"freezed" - FW can't defragment in at all.
LOH is where the object over 85kb locates.

So, relating to the some intro above seems that you allocated the objects
which the size is over the 85kb and FW can't find the free 16/32MB segment
block in LOH to put your object.

The solution of this to review your code, find where you locate big sized
object at once and try to divide them into small blocks, to avoid them being
put to LOH

---
WBR, Michael Nemtsev [C# MVP].
[.Net Tips & Tricks]: http://msmvps.com/blogs/laflour/pages/net-tips-amp-tricks.aspx
My blog: http://spaces.live.com/laflour/ Team blog: http://devkids.blogspot.com/


"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

MN> Hello jerry,
MN>
MN> The memory in .NET world is fragmented. Each time your app needs
MN> some memory it's assigned in blocks of 16/35mb by FW. While your app
MN> works your can perform some memory allocation which is pinned, GCed
MN> and etc, and once you can end up with the situation when you have
MN> 1GB free time
MN>
MN> ---
MN> WBR, Michael Nemtsev [C# MVP].
MN> [.Net Tips & Tricks]:
MN> http://msmvps.com/blogs/laflour/pages/net-tips-amp-tricks.aspx
MN> My blog: http://spaces.live.com/laflour/ Team blog:
MN> http://devkids.blogspot.com/
MN> "The greatest danger for most of us is not that our aim is too high
MN> and we miss it, but that it is too low and we reach it" (c)
MN> Michelangelo
MN>
j>> I have a program using VB express where I have about 50 forms
j>> through
j>> out the
j>> program on various forms I have multiple BMP pictures on the form,
j>> when I
j>> went to create a new form and put about 6 bmp pictures on it,it gave
j>> me a
j>> error saying I did not have enough memory. Is there a limit? why is
j>> it doing
j>> this?
j>> Thanks,
j>> Jerry
 
H

Henning Krause [MVP - Exchange]

Hello,

a Memory Profiler might help you to solve your problems. There's a good one
from SciTech. They also have a 30 day trial version.

Kind regards,
Henning Krause
 
C

Chris Dunaway

I have a program using VB express where I have about 50 forms through out the
program on various forms I have multiple BMP pictures on the form, when I
went to create a new form and put about 6 bmp pictures on it,it gave me a
error saying I did not have enough memory. Is there a limit? why is it doing
this?
Thanks,
Jerry

How big are these .bmp's? And how many of them? Are they static?

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top