How much memory can I use

M

M

I wrote a c++ program which utilizes a bitset<80> map. If I do a sizeof
bitset<80> it says 12 bytes and there's no limit to the number of entries I
can add to the map. What I mean is the number of entries is limited to
memory because if I create 10 bit combinations of 80 that can max out at
1,646,492,110,120 combinations nCk(80,10). Multiply that by 12 and it's off
the charts

So how many combinations can I create given the size of the memory of the
pc. For example I would like to calculate how much memory there is and
report to the user 'give your memory size I can only create X number of
combinations'. but I'm not sure how to do that.

Also it started as a c++ program then stl got in the picture and finally MFC
came into the picture with a logging class I added so maybe those take away
from the pool I can play in.

I was reading about how windows programs get 2 meg to play with and are
allocated more when they need it but when I run this program for a huge
number of combinations it just gets slower and slower and eventually I kill
it but the pc isn't quite right until it gets rebooted. I think someone how
windows loses is mind when dealing with that many combinations and doesn't
know what to do until it s rebooted.

Any thoughts?


thanks alot !!!
 
K

Karl Heinz Buchegger

M said:
I was reading about how windows programs get 2 meg to play with and are
allocated more when they need it but when I run this program for a huge
number of combinations it just gets slower and slower and eventually I kill
it but the pc isn't quite right until it gets rebooted. I think someone how
windows loses is mind when dealing with that many combinations and doesn't
know what to do until it s rebooted.

Any thoughts?

Yes. Research the topic of 'virtual memory'
www.google.com might be of some help to do this.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top