|
|
Salut Florin,
As stated in MSDN "The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes" but AFAIK you cannot pass beyond how much memory a process can handle, i.e. 4GB for Win32(see my first answer).
Ovidiu Cucu
Microsoft MVP - Visual C++
Cofounder CODEXPERT.RO
|
|
|
|
|
I guess I need another cup of coffee
Florin Crişan
|
|
|
|
|
Me too!
Ovidiu Cucu
Microsoft MVP - Visual C++
Cofounder CODEXPERT.RO
|
|
|
|
|
I think only Vista (Amongst microsoft OS) is 64 bit OS. And I heard that it has problems. So I am try to avoid it.
So much memory is required becuase it is multiuser application and each user can fetch upto big set of data in memory for processing. So even if one user takes 20 MB, then 100 simultaneous users can occupy 2 GB.
|
|
|
|
|
Actually, there are 64-bit editions of XP Professional, Server 2003 and Vista.
Anyway, you may want to consider processing the data in smaller chunks (you may not need to load whole files in the memory). Allocating more than the physical memory will seriously degrade performance (virtual memory is much slower).
You might also want to try distributing the workload to several machines
But, of course, this is just generic advice – I don't really know what your application does
Florin Crişan
|
|
|
|
|
... and by files I mean data, even if it comes from a database
Florin Crişan
|
|
|
|
|
Yes. I have to explore distributing the workload on multiple machines using web farming if the 2 GB limitation could not be overcome. However I am trying to avoid it as it will add up the cost.
|
|
|
|
|
Hi,
all objects are allocated in a single address space, which on a 32-bit operating system
cannot extend beyond 4GB. Actual systems such as Win XP do impose further restrictions;
XP normally deals with 2GB of address space, you can optionally increase that to 3GB.
You want all objects get the number of bytes (hence address range) that their sizes
indicate, and you want all objects non-overlapping, so once their sizes add up to more
than 2 or 3GB game is over.
The size of physical memory plays no role in this; whatever spills over goes into
a disk file where the non-physical memory is temporarily stored; making that file larger
than 2 or 3GB does not make much sense: all addresses (32-bit pointers) must still be
unique and the objects non-overlapping.
On a 64-bit operating system, all pointers occupy twice the amount of space, but the
available address space is theoretically squared, in practice much much larger than you
will ever need.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hai,
what is the limit for number threads we can create in our machine...i heard that is 2000...is it right?
if it is so, den Using IOCP in a thread pool, how many threads, we can create..?
reply me
Mani
Born to win...!
|
|
|
|
|
I don't know if there is a real physical limitation but for you, I think the limitation will be how far would you accept the slowdown of your program ? Using that many threads will bring your program to its knees and it will spend more time switching between the threads than doing effective things.
Some people already told you that, so why do you want to go that direction ? Why do you want to try to readh the limits of your system ? It's certainly not the most efficient way to do it.
|
|
|
|
|
hai,
just i want to know the maximum limit for the threds when Using IOCP...,
Creating that many threads is the complex way, that is correct...i am accepting...
but i want to know how many threads we can create in IOCP....
Born to win...!
|
|
|
|
|
As stated in MSDN the maximum maximorum number of threads you can create is 2028.
That is the limit for the default stack size of 1 MByte.
However if you increase the stack size (see dwStackSize, second parameter in CreateThread documentation), the number of threads that can be created decreases accordingly.
-- modified at 3:31 Friday 23rd November, 2007
... and don't forget to count the threads already existent ...
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
I'm not sure if I answered this for you a couiple days ago, but here it is again...
There's almost NO need to have more threads than you have processors.
There's never going to be more threads than the number of available processors
executing at the same time, so any other threads are sitting there wasting memory
and other resources.
The whole idea of an IOCP is based on these facts. The IOCP acts like a FIFO queue
where each operation is queued to the next available thread. It's extremely efficient in
both speed and resource usage, since you only need at most, a couple threads per processor.
If you're even considering the maximum number of threads Windows is going to let you create,
then an IOCP is useless and you're going to have a serious performance problem with
your application.
Here's some handy articles - they are socket related, but the same IOCP principles apply
(IOCPs can be used for more than just servers )
Writing Windows NT Server Applications in MFC Using I/O Completion Ports[^]
Windows Sockets 2.0: Write Scalable Winsock Apps Using Completion Ports[^]
INFO: Design Issues When Using IOCP in a Winsock Server[^] <-- see tip #2 here for choosing thread pool size!!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
<quote>
There's almost NO need to have more threads than you have processors.
Just almost.
Ovidiu Cucu
Microsoft MVP - Visual C++
Cofounder CODEXPERT.RO
|
|
|
|
|
Yes, almost. For threads that wait for periods of time, like doing device I/O,
there can be an advantage having more threads since during those
I/O waits other threads can get some work done.
It's something that has to be tuned depending on what the threads are or
can be doing, available resources, etc.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Friends,
Im using TWAIN in my application(SDI) to capture the image using digital camera.
I dont want to use the Sources UI. So I want to use my own UI for preview. ie:View as my UI.
Plz anybody help me..
Thanks in advance,
Reagards
Shiva
|
|
|
|
|
Have you studied the "Alternative User Interfaces" section of the TWAIN Specification?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ya Mark,
But im exactly not gettting how to implement it.
can u halp me..?
Reagards
Shiva
|
|
|
|
|
I worked out the .ico file use "Axialis IconWorkshop", with 2 icons in.
One is (16*16 256), the other is (32*32 256).
ID is IDR_MAINFRAME.
When I run the program, the icon in the about dialog has been replaced with the new one. But the icon where the system menu hasn't been replaced. Why?
|
|
|
|
|
Did you use of SetIcon(hIcon,True); and SetIcon(hIcon,False); ?
|
|
|
|
|
I set it after LoadFrame, it's ok now, thanks.
|
|
|
|
|
I gald you could solve it.;)
|
|
|
|
|
Is it possible this is an MDI/SDI app, and it's using the documents icon for the system menu, rather than your IDR_MAINFRAME one?
Iain.
|
|
|
|
|
surely
I set it manually, it's ok now, thanks.
|
|
|
|