473,657 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Memeory limitation problems ???

I Have a PC with dual XEON CPU’s and 4 Giga Byte RAM win Windows XP Pro.
I have 2 problems with it:
(1) Windows is showing only 3.25 Giga byte on the System Properties ?
General tab.
While the bios to see all of the 4 GBytes.
I some article I read that the WinXP Pro can only handle 4GBytes of memory
including the virtual memory, so I set it to not use any page file, but it
did not help.
(2) I want my .NET application to use more then 1.2 GByte of memory, so I
insert at the Boot.ini file the /3GB flag and did reboot. Now I also need to
add to my application linker the /LARGEADDRESSAWA RE flag for it to be
IMAGE_FILE_LARG E_ADDRESS_AWARE (see
http://www.microsoft.com/whdc/system...E/PAEmem.mspx). But I
find no where to put the flag in the project properties.

Can anybody tell me how solve this 2 issues?
--------
Thanks
Sharon
Nov 17 '05 #1
17 3696
Hi Willy,

Thanks for your replay.

(1) I found a discussions about the same issue:
http://msdn.microsoft.com/newsgroups...f-0c3b9681dd2b
and it seems to succeed with the 4Mbytes RAM. So I very much need to do it.
Also, the Windows Xp 32 bit Pro documentation indicate that it can consume
up to 4MB.
The BIOS does recognize the extended RAM as 4,192,768 bytes. so I really
need this.
(2) About the drawback - Don't you think that 1GB of RAM should be enough
for the kernel?
---------
Thanks
Sharon
Nov 17 '05 #2

"Sharon" <Sh*****@newsgr oups.nospam> wrote in message
news:F3******** *************** ***********@mic rosoft.com...
Hi Willy,

Thanks for your replay.

(1) I found a discussions about the same issue:
http://msdn.microsoft.com/newsgroups...f-0c3b9681dd2b
and it seems to succeed with the 4Mbytes RAM. So I very much need to do
it.
Also, the Windows Xp 32 bit Pro documentation indicate that it can consume
up to 4MB.
The BIOS does recognize the extended RAM as 4,192,768 bytes. so I really
need this.
(2) About the drawback - Don't you think that 1GB of RAM should be enough
for the kernel?
---------
Thanks
Sharon


1) A windows application is limitted to 2GB or 3GB of virtual address space
depending on the set-up.
If you think you need 3GB you have to set the /3GB switch in boot.ini and
you need to link your application with the /LARGEADDRESSAWA RE switch set.
..NET managed application not linked, here you have to pass the exe file to
editbin.exe with the /LARGEADDRESSAWA RE switch set (editbin.exe will set the
IMAGE_FILE_LARG E_ADDRESS_AWARE bit in the PE header).

Not sure what you mean with "I really need this".
- Your program will never be able to use 4GB on a 32 bit windows OS. And you
will never be able to use 4GB RAM unless you run a 64 bit windows version
with "memory remapping" enabled (in the BIOS or software).
- Your application will never be able to allocate a single array larger than
~1.5GB, if this is what you want forget this whole /3GB thing, your only
option is Windows XP64 or W2K3 64.

2) I don't know it depends on so many things, it depends on the number and
type of HW devices, it depends on the software running, the number of
processes number of threads etc.
Why do you think 1GB is more than enough for the kernel, while 2GB is not
enough for your single application?

Some KB articles you should read carefully before deciding to go down that
road.

http://support.microsoft.com/default...b;en-us;319043
http://support.microsoft.com/kb/316739/EN-US/

Willy.


Nov 17 '05 #3
Hi Willy,

Thanks a lot for your prompt replay.

(1) I already did all that is necessary for my application to use more then
2GB and it's working fine now.

When I say "I really need this", I mean that I need the Windows operation
system to recognize all the 4GB installed.

(2) I think that the Windows kernel will run nicely on a 1GB RAM because my
PC is a dedicated PC and I can tell what will run on it, so as I see it 1GB
seems to be fine, after all; Windows XP Pro can run on a 256 MB PC's as well.

After reading the MSDN KB you mentioned, I can see that is for Windows 2003
servers (one of the KB) and the other is saying that it may happen, but it is
not happening in my case as everything is running OK after I applied the /3GB
switch.
So now the only trouble I have is how to make the Windows XP Pro 32 bit with
SP2 to see all of the 4GB installed and not only 3.25 GB ?
--------
Thanks
Sharon
Nov 17 '05 #4

"Sharon" <Sh*****@newsgr oups.nospam> wrote in message
news:22******** *************** ***********@mic rosoft.com...
Hi Willy,

Thanks a lot for your prompt replay.

(1) I already did all that is necessary for my application to use more
then
2GB and it's working fine now.

When I say "I really need this", I mean that I need the Windows operation
system to recognize all the 4GB installed.

(2) I think that the Windows kernel will run nicely on a 1GB RAM because
my
PC is a dedicated PC and I can tell what will run on it, so as I see it
1GB
seems to be fine, after all; Windows XP Pro can run on a 256 MB PC's as
well.

After reading the MSDN KB you mentioned, I can see that is for Windows
2003
servers (one of the KB) and the other is saying that it may happen, but it
is
not happening in my case as everything is running OK after I applied the
/3GB
switch.
So now the only trouble I have is how to make the Windows XP Pro 32 bit
with
SP2 to see all of the 4GB installed and not only 3.25 GB ?


As I told you previously, the Windows OS CAN see/access most of the 4GB RAM
space, but 'you' can't see all the 4GB RAM, part of this (above 3.25GB in
your case) is taken by the hardware mapping done by the system BIOS, for
instance your video RAM (depending on the size) must be mapped into that 4GB
address space to be addressable by a 32 bit OS. A 64 bit system running a 64
bit OS can remap this area (some chipsets do not !!!, so please check your
systems BIOS to see whether this is possible) to some address outside the
installed RAM space, but this same system running a 32 bit OS cannot, simply
because a 32 bit OS cannot address anything above 4GB.

You remark on point 2 make little sense, you need to make a clear
destinction between RAM space and virtual memory (that is RAM + pagefile
space). A 256 MB RAM system will have a hard time to run anything
significant without a pagefile, don't even try to run a DirectX or OpenGL
application on such system with a 128/256MB RAM video card installed, it
wont work (even not with a 500MB pagefile).
And don't forget that a system with 4GB installed RAM will have a 16 times
larger page table (kernel space) than a 256 MB system.

Willy.

Nov 17 '05 #5
I must say it looks a too much memory for only mapping. It's also mean that
the Windows XP OS can not really use 4GB but less. But how much less? 3.25GB
looks like a very much less.

Furthermore, I extended the memory to 4GB in order to allow to my
application to use up to 3GB. But if the OS sees only 3.25GB it will not let
my application use the amount of memory I want it to use.

So my final question is which is very important to me:

In the case I described (4GB RAM that shown as a 3.25GB), does my
application can use up to 3GB (after applying the /3GB in the Boot.ini and
adding the IMAGE_FILE_LARG E_ADDRESS_AWARE flag to my app image header)?
--------
Thanks
Sharon
Nov 17 '05 #6

"Sharon" <Sh*****@newsgr oups.nospam> wrote in message
news:BD******** *************** ***********@mic rosoft.com...
I must say it looks a too much memory for only mapping. It's also mean that
the Windows XP OS can not really use 4GB but less. But how much less?
3.25GB
looks like a very much less.
No, Windows XP 32 cannot use the full 4GB RAM space, because the hardware
components memory must be mapped in this address space, the amount of mapped
memory space depends on the type and number of controllers, expecially video
controllers can take a large amount of this (there are Nvidia boards with
512MB memory on board) and they have to be aligned on a 256MB boundary. In
your case it looks like you have a 256MB video board or at least a board
that is mapped at that address (0XD0000000).
Furthermore, I extended the memory to 4GB in order to allow to my
application to use up to 3GB. But if the OS sees only 3.25GB it will not
let
my application use the amount of memory I want it to use.
Why? 3.25 GB is more than 3GB isn't it? Plus, you don't need 3GB RAM for an
application to consume 3GB of memory, please read my other reply where I
explain the difference between virtual and physical memory.
So my final question is which is very important to me:

In the case I described (4GB RAM that shown as a 3.25GB), does my
application can use up to 3GB (after applying the /3GB in the Boot.ini and
adding the IMAGE_FILE_LARG E_ADDRESS_AWARE flag to my app image header)?

Well you have to be more specific, 3GB is the max. space on a system that
has /3GB enabled and IMAGE_FILE_LARG E_ADDRESS_AWARE set for the application,
BUT that doesn't mean your program code can allocate all 3GB, first you have
your code and the runtimes mapped in this address space, you have the space
reserved by the stacks (1MB per thread) and you have holes in this address
space that can't be used - a 64 KB hole at the start (address range 0-FFFF)
and a hole before the end of the 2GB range (7FFF0000-7FFF0000). And you have
to consider the mapping of the DLL's (code) into that address space (some
are mapped at a very unfortunate location). All these mappings and holes
result in a fragmented virtual memory space,so you don't have one single
large chunk of free memory, no you have several chunks from which the
largest is ~1.4 GB for a minimal .NET application.
That means that at best, the largest array that can be allocated is ~1.4GB
(but that's never guaranteed!!!), allocating four arrays of 0.5 GB plus a
couple of 100MB arrays on a /3GB system, should mostly succeed, but again
this is never guaranteed, VM can become framgmented over time.

One last suggestion, if you absolutely need to allocate a single array
that's larger than say 1GB, you should consider moving to Windows XP 64,
here you can remap the HW to addresses above 4GB and the VM address space is
4GB for 32 bit applications.
Note that whatever OS you are using, the max. size of an array in .NET is
2GB (the max size of whatever CLR object).
Willy.

Nov 17 '05 #7
OK, I see what you mean.

Allow to me to explain the real problem and requirements that led to the
trouble at hand;

I'm developing a project that need to take large image at a time, load it
all into memory and do some image processing.
The images are of type TIF file 62992 x 113386 Pixels, Huffman RLE
compression, 3200 x 3200 DPI resolution, binary colored (1 Bit Per Pixel),
file on disk size 43.08 MB (45,169,042 Bytes).
This kind of image should consume 851.66 MB (893,028,184 Bytes) of memory
when loaded (this is what it takes using the IrfanView
http://www.irfanview.com/) and a project at
http://www.codeproject.com/bitmap/graphicsuite.asp), and this is exactly what
I want it to consume. Otherwise; the representation per pixel will be 1 byte
(8 Bits), which means that this kind of image require 6.652 GB (7,142,410,912
Bytes) that I absolutely can not have in any possible way.

I found that the Bitmap object can hold 1 bit per pixel, but for some
reason, it can not handle this kind of picture and throws ArgumentExcepti on
saying
"Invalid parameter used". But if I load the image using
Image.FromFile( imageFilePath) it throw en OutOfMemoryExce ption saying "Out Of
Memory" and it's because it consume twice the memory it should (not 8 times
the memory).

So, in order to meet with this requirements we took a dual XEON PC with 4GB
memory and set the Boot.ini with the /3GB and linked our application with the
IMAGE_FILE_LARG E_ADDRESS_AWARE flag to my application image header. Yet it
still fails.

So, we are doing the image processing algorithms using unmanaged C++, but
yet, I need to load a high resolution sample of the image I mentioned above
by loading it to a Bitmap object and reduce it size to loaded to a PictureBox
control.
I already have a very good code for resizing the image, but it required a
Bitmap object, and it fails to load this image as I described above.

Now you have the bigger picture to understand the actual problem.

In this stage, using Windows 64 bit, is not an option, but it's the only
solution, we may use it.

Do I need to change something in my code on in my assembly to use a 64 bit
Windows system?
Can I still work with the same PC hardware (CPU's, devices etc.)?
What do you think?
--------
Thanks
Sharon
Nov 17 '05 #8
I have some more info:

At the PC device driver a saw that the PC has ASUS Extreme graphics adapter
with 128 MB and another ASUS graphics adapter with 128 MB as Secondary
(memory range D8000000-DFFFFFFF, D0800000-D080FFFF, 000A0000-000BFFFF). The
PC also installed with LAN and GLAN, and a Ceroco Imaging device X64-CL_iPro
Board (memory range D0400000-D07FFFFF).

I have posted another question on the win32.programme r.kernel Discussions, I
the answer I gat is very confusing
http://msdn.microsoft.com/newsgroups...5-ad91520ac866
I actually say that it does see the installed 4GB.

What do you think?

--------
Thanks
Sharon
Nov 17 '05 #9
See inline

Willy.

"Sharon" <Sh*****@newsgr oups.nospam> wrote in message
news:DB******** *************** ***********@mic rosoft.com...
OK, I see what you mean.

Allow to me to explain the real problem and requirements that led to the
trouble at hand;

I'm developing a project that need to take large image at a time, load it
all into memory and do some image processing.
The images are of type TIF file 62992 x 113386 Pixels, Huffman RLE
compression, 3200 x 3200 DPI resolution, binary colored (1 Bit Per Pixel),
file on disk size 43.08 MB (45,169,042 Bytes).
This kind of image should consume 851.66 MB (893,028,184 Bytes) of memory
when loaded (this is what it takes using the IrfanView
http://www.irfanview.com/) and a project at
http://www.codeproject.com/bitmap/graphicsuite.asp), and this is exactly
what
I want it to consume. Otherwise; the representation per pixel will be 1
byte
(8 Bits), which means that this kind of image require 6.652 GB
(7,142,410,912
Bytes) that I absolutely can not have in any possible way.

I found that the Bitmap object can hold 1 bit per pixel, but for some
reason, it can not handle this kind of picture and throws
ArgumentExcepti on
saying
"Invalid parameter used". But if I load the image using
Image.FromFile( imageFilePath) it throw en OutOfMemoryExce ption saying "Out
Of
Memory" and it's because it consume twice the memory it should (not 8
times
the memory).

This is how GDI+ works (wrapped by the System.Drawing) , Image.FromFile
instructs GDI+ to load the file as a memory mapped object and from that it
builds an imageobject (fi. a Bitmap). That means at some point in time you
have the file data and the bitmap data allocated in unmanaged memory (yes,
they are unmanaged resource), this roughly represents two times the file
data. The same thing is done using IrfanView or any other unmanaged tool,
what's different is that once the Bitmap is built, the file is closed and
the mapped memory released (you can check this with perfmon), while when
using .NET the resources are released when you call Dispose on the image.
So, if it works with the tools you mentioned, it should work with .NET also.
Did you try by simply loading the tiff file using a small console program.

public static int Main()
{
Image i = Image.FromFile( @"YourtTiffFile ");
}

So, in order to meet with this requirements we took a dual XEON PC with
4GB
memory and set the Boot.ini with the /3GB and linked our application with
the
IMAGE_FILE_LARG E_ADDRESS_AWARE flag to my application image header. Yet it
still fails.

So, we are doing the image processing algorithms using unmanaged C++, but
yet, I need to load a high resolution sample of the image I mentioned
above
by loading it to a Bitmap object and reduce it size to loaded to a
PictureBox
control.
Why don't you load and reduce it's size using C++ as well?
I already have a very good code for resizing the image, but it required a
Bitmap object, and it fails to load this image as I described above.

Now you have the bigger picture to understand the actual problem.

In this stage, using Windows 64 bit, is not an option, but it's the only
solution, we may use it.

Do I need to change something in my code on in my assembly to use a 64 bit
Windows system?
Can I still work with the same PC hardware (CPU's, devices etc.)?

Don't know for sure, it depends on the exact CPU type (should be 64 bit
capable) and other devices. Anyway, you should try this to be sure. I guess
you can obtain an evaluation versions of W2K3 64bit or XP64 from MS.

Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2270
by: Erik Max Francis | last post by:
I've come across a limitation in unpickling certain types of complex data structures which involve instances that override __hash__, and was wondering if it was known (basic searches didn't seem to come up with anything similar) and if there is a workaround for it short of restructuring the data structures in question. The fundamental issue rests with defining classes which override __cmp__ and __hash__ in order to be used as keys in...
2
3155
by: terpatwork | last post by:
Hi, (1) I have an access form that allows users to enter data, and when they click a button, the OnClick code that I've written uses a SQL INSERT statement to insert the data into the database. I come from a web programming background, so please forgive me if there is some better approach to use in Access to accomplish this. My problem is that when users type in more than 512 characters (in a Memo field) and click the button, only the...
3
14646
by: Seong-Kook Shin | last post by:
C FAQ Q 13.2 says that sprintf() is guaranteed to work only for n <= 509: sprintf(dest, "%.*s", n, source); Does 509 appear in any C standard? If not, where it came from? I looked over C99 (ISO/IEC 9899:1999) but didn't find yet. If that limitation is old standard (perhaps ANSI?), does it limit the total length of the string that sprintf() would print, or just for one '%s'?
4
1847
by: Bill Burris | last post by:
When compiling my solution which contains 15 projects (2 Window Apps, 2 Services, 11 class libraries, C#, MC++, & C++), I was receiving warnings about symbols defined in multiple places. Selecting Rebuild Solution did not make the problem go away. After selecting Clean Solution, followed by Rebuild Solution, the problem went away. I had always assumed that rebuild meant starting over, recompiling all code, and linking with the...
7
1476
by: Rob Nicholson | last post by:
We're using a well known presentation layer library to implement complex controls on an intranet site. IE has the following limitation which effectively means that you can only have 30 <STYLE> tags per page. That's in effect 30 style sheets per page, not classes - each sheet can have as many style classes as you want. http://support.microsoft.com/default.aspx?scid=kb;en-us;262161 Unfortunately, this presentation library generates...
2
14340
by: Joseph Geretz | last post by:
I'm developing a Web Service using DIME to download and upload files from and to an IIS server. In order to increase the download filesize to unlimited, I have the following block in my App.config and Web.config files: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging> The largest file I've downloaded is 70 meg and that's more than plenty for me. However, I'm finding that on upload, if I attempt to upload greater than
20
1751
by: jht | last post by:
I Have a workstation with AMD64 CPU’s and 6 Giga Byte RAM ,OS Windows XP 64. I have 2 problems with it: 1.I want my .NET application(VS.NET 2003 VC++7.0) to use more then 3 GByte of memory,how to do? VirtualAlloc can do it? 2.I use VS .NET 2003,it can not use more than 3GByte of memory,so I want to install VS2005 to do it ,but VS2005 can not installed ,"MSXML 6.0" install failed. Can anybody tell me how solve this 2 issues?
6
2704
by: AB | last post by:
Hello all, I heard once that there is a limitation on the number of lines of code that a program can have when using C, but not for C++. Is this true? Any ideas?
2
2974
by: fdcm | last post by:
Hi, I am new to Access 2003 on XP. I am creating a database from a current report that has exceeded Excel 2003's row limitation. My concern is running into an Access limitation after creating the database. I have read the post entitled "How to overcome the size limitation of MSAccess" and it was very helpful. However, is there a definitive answer as to how many records a 2GB database can hold? or is it dependent upon the record size (2 fields...
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.