Application by using more than 65535 UDP ports

Hello all!
I'm now implementing a device simulator in VC++ to performance a load test to our server application. I need to simulate a huge number of devices to communicate with this server via UDP, each device shall have its own UDP port exclusive during the
simulation.
Since there are maximal 65536 ports pro IP address and from 0 to 1024 are reserved by OS, theoretically I have 64511 free ports for my Simulator application, considering some ports are required by some services/applications, the free port number may a little
fewer, I'm assuming this number is 60000. According to our software requirement, I can't reach the required simulating device amount under this port limitation.
If I'm right, if one computer has more IPs, I shall have more than 60000 free ports. My simulator runs under Windows Server 2008, 2 physical network adapters and I used following command to change the dynamic UDP port range to get 60000 UDP ports:
      netsh interface ipv4 set dynamicportrange protocol=udp startport=3000 numberofports=60000
My questions are:
1. Is this setting globally available or for each IP address?
   I tried to set the parameter "numberofports" to 120000 but it didn't work.
2. Shall I set for each IP address separately a UDP port range?
3. If this setting is for each IP addres available, I have following problem:
   For two IP address, I could bind 60000 ports in total to 60000 UDP sockets, e.g IP1 20000 ports and IP2 40000 ports, or IP1 40000 ports and IP2 20000 ports. That means I can still use maximal 60000 UDP ports.
Unfortunately, I can't find any reference about this topic in Internet, does anyone have my similar situation?
Thank you in advance to teach me a solution!

" I need so many UDP ports because our product has "state", and our Server application maintains connection sessions for each connected device."
Couldn't you add some information to the datagrams that identify the state? That may require less resources than creating a zillion of sockets. Though I suppose that using a single socket would lead to serialization and that will hurt scaling...
"How much memory does one socket need? I didn't think about this topic....."
Hmm, memory is need for the socket data structures and buffers. Probably a few kilobytes. Let's do a test and see what happens:
#include <winsock2.h>
#include <cstdio>
#pragma comment(lib, "ws2_32.lib")
DWORD WINAPI ServerThread(LPVOID addr) {
SOCKET sk = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sk == INVALID_SOCKET) {
printf("socket failed\n");
return 1;
int err = bind(sk, static_cast<sockaddr *>(addr), sizeof(sockaddr_in));
if (err != 0) {
printf("bind failed\n");
return 1;
char buffer[256];
sockaddr_in from;
int fromLen = sizeof(from);
for (;;) {
int length = recvfrom(sk, buffer, 256, 0, reinterpret_cast<sockaddr *>(&from), &fromLen);
printf("got %d bytes from %s:%d\n", length, inet_ntoa(from.sin_addr), htons(from.sin_port));
int main() {
WSADATA wsaData;
int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
sockaddr_in to;
to.sin_family = AF_INET;
to.sin_port = htons(4242);
to.sin_addr.S_un.S_addr = inet_addr("192.168.1.68");
CreateThread(nullptr, 0, ServerThread, &to, 0, nullptr);
const char *addrs[] { "192.168.1.40", "192.168.1.41", "192.168.1.42", "192.168.1.43" };
SOCKET sockets[_countof(addrs)][30000];
sockaddr_in from;
from.sin_family = AF_INET;
int count = 0;
for (int i = 0; i < _countof(addrs); i++) {
from.sin_addr.S_un.S_addr = inet_addr(addrs[i]);
for (int j = 0; j < _countof(sockets[i]); j++) {
SOCKET sk = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
from.sin_port = htons(65535 - j);
err = bind(sk, reinterpret_cast<sockaddr *>(&from), sizeof(from));
if (err != 0) {
printf("bind failed while creating socket %d on %s:%d\n", count, addrs[i], 65535 - j);
closesocket(sk);
sk = INVALID_SOCKET;
else {
count++;
sockets[i][j] = sk;
printf("created %d sockets\n", count);
char buffer[256];
for (int i = 0; i < _countof(sockets); i++) {
for (int j = 0; j < _countof(sockets[i]); j++) {
if (sockets[i][j] != INVALID_SOCKET)
err = sendto(sockets[i][j], buffer, 256, 0, reinterpret_cast<sockaddr *>(&to), sizeof(to));
This creates almost 120000 sockets on my machine (Win 8.1). All the 192.168.1.x addresses are on the same network adapter, 4 of them are used for "clients" and 1 for the "server". Clients have ports in the range 35535 - 65535 so you get
around 30000 sockets per address (a few ports are in use so you won't get exactly 30000 unless you adjust the code).
When the program starts the kernel non paged pool jumps from ~50MB to ~200MB. That means around 1.3KBytes per socket.
@Joel Engineer: "The windows operating system can only have one IP per Computer name and a computer can only have one name..."
You're delusional.

Similar Messages

  • Using more than one USB Port at a time?

    So, I'm trying to record something in a project using my Rocksmith USB to 1/4 inch cable, but I also need to make a screen recording of me doing that for a school project using my RockBand USB mic. The problem for me is that only one USB Port recognizes these two, and the three that don't aren't dead, as they work with everything else I have. How do I set it so that more than one USB port can recognize these devices? I don't want to have to keep switching every time.

    Thanks mhartnett.
    I have looked at the example on the link you gave. According
    to the example for the FileReferenceList in the documentation, it
    seems to make multiple or rather separated requests to the
    server-side upload script.
    So for example if I have 3 files to upload, the script will
    call the the upload() function of the FileReference class thrice
    with the URLRequest(which is the server-side upload script). So in
    this case, my server-side script that is handling the upload will
    only upload one file at one time.
    Is there a way where I can have say all the 3 files sent
    together to the server-side script, and then have them uploaded all
    at once within the server-side script itself?
    So say my PHP file, I could have access to like
    $_FILES['Filedata1'], $_FILES['Filedata2'] and $_FILES['Filedata3']
    together at one request.

  • Using more than one Ethernet port

    So I just brought myself another pair of TP link wifi adapters as I already had some, but the ones I had only had 1 port and these have 3. So I set it all up and try to use 2 ethernet ports as I want to use my xbox one and Laptop through these adapters. So when i set it up and pluged the ethernet cables into the router the broadband light on the hub goes orange and the broadband is lost unitl i take out one of the ethernet cables and reset the hub it works fine with just one. 
    I just really want to know why i cant have more than one ethernet cable plugged into the hub.
    Solved!
    Go to Solution.

    You can only connect one broadband extender to the home hub. This must be designated as the Access Point. All the rest need to be slaved to that Access Point. These need to be individually "paired" to the AP one connected to the home hub.
    You can still use the other ports on the home hub for direct Ethernet connections.
    If you try and connect more than one extender to a home hub Ethernet port, you will create a loopback, which will crash the home hub.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • How to use more than one application server during initial load?

    Hi,
    we plan to use more than one application server in CRM during initial download in order to increase the number of parallel requests and to decrease the time for the initial load. Is there a way to allocate requests to more than one server? Is is possible via multiple rfc connections for consumer CRM in CRMRFCPAR?
    Thanks.
    Alexander Schiffer

    Hi Naresh,
    thanks for your answer. It has solved my problem. SMLG is the transaction that I was looking for.
    Two more OSS notes that helped me to guide our basis into the right direction:
    OSS 593058 - New RFC load balancing procedure
    OSS 1413986 - SMLG: Possibility to select a favorite type for Ext.RFCs
    Thanks again.
    Alexander Schiffer

  • How can I use more than one Data Provider in my web Apps

    I am trying to use two different data provider in my web apps to run two different queries from the same table ,the data provider A is working correctly but when I attempt to run data provider B ,It display an error page ,here is the error message : Exception Details :javax.servlet.ServletEx ception
    java.lang.RuntimeException: java.sql.SQLException : Cannot connect .Both dataSourceName and url properties are null.

    Hi,
    You can use more than one data provider in your application. However if you have defined a dataprovider for a particular table already, and wish to bind a component, select the component and use its context menu to Bind to Data...

  • How can I get more than one firewre port ?

    Hello,
    how can I get more than one firewire port ? I'd like to be able to connect my canon HV30 camera as well as my firewire external HD at the same time so I can use firewire to upload the videos I've taken. Is this possible?
    TIA

    Hi ginestre-
    Many FireWire hard drives have 2 firewire ports so that you can daisy-chain devices and connect the camera that way.
    Daisy-chaining is not the most reliable method, but it works, so you could buy a FireWire hub.
    Luck-
    -DP

  • Can I use more than one midi keyboard?

    I'm curious If I can run more than one midi application, is this possible?

    SuitcaseRecordings wrote:
    Can I use more than one midi keyboard?
    In Logic, yes.
    I'm curious If I can run more than one midi application, is this possible?
    Yes. you have to set up the Midi, pslit it up between the applications. e.g. channels 1-8 to app 1, and channels 9-16 to app 2.
    Then select the channels according to what application you want to play.
    "My spoon has run dry now..."
    Cheers

  • How to use more than one JCo in one project?

    hi all,
    I want to use more than one r/3 systems and want to switch between them while running the application.
    For that, how can I use more than one JCo connection in one project and how to activate/deactivate them so as to switch in between them? And if that possible then what am I suppose to do in order to fetch the data from activated R/3 while running the application.
    Regards,

    Hi,
    Try this threads
    Multiple Client Logon in JCO
    Multiple JCO client connections
    Regards
    Saravanan K

  • JVM Using more than -Mx Memmory and RSS

    Hi All,
    Used -Xms256m -Xmx512m parameters for weblogic Admin server 10.0.1.0, 9.2.2, but the server is using more than the value specified and it is not
    happening for weblogic version 10.3, This was found while cross checking with
    ps and prstat.
    and no application is deployed in the above admin instance.
    Process grep'd below
    bash-3.00# ps -ef | grep -i java
    advboprd 13639 1279 1 Mar 06 ? 1673:18 /usr2/BEA10MP3/jdk160_05/bin/java -server
    -DWls10=bocaejb-admin -Xms256m -Xmx512 (THIS IS WLS 10.3 WORKING AS EXPECTED)
    advboprd 28246 1279 0 Mar 07 ? 159:38 /usr2/BEA92MP2/jdk150_10/bin/java -server -Dwls92=ace-admin -Xms256m -Xmx512m - (THIS IS WLS 9.2.2 NOT WORKING AS EXPECTED)
    advboprd 1616 1279 1 Jan 18 ? 141803:32 /usr2/BEA10MP1/jdk150_11/bin/java -server -DWls10=vtm-admin -Xms256m -Xmx512m -(THIS IS WLS 10.0.1.0 NOT WORKING AS EXPECTED)
    Cross checked the same process with prstat
    bash-3.00# prstat | grep -i java
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
    1616 advboprd 3173M 2932M cpu21 22 0 2363:33:0 21% java/150
    13639 advboprd 466M 447M run 7 0 27:53:56 1.7% java/93
    28246 advboprd 758M 541M run 59 0 2:39:41 0.0%
    java/91
    Please note the the process id 1616,28246 are corssing the specified value where as
    the process 13639 (10.3) is not.
    Memmory Value defined
    CMD="${JAVA_HOME}/bin/java -server -D${VERSION_LABEL}=${PROC_NAME} -Xms256m -Xmx512m \
    -XX:MaxPermSize=128m \
    -da \
    As I know JVM uses a extra memmory for JVM internal use, however but not expected to consume this huge memmory.
    -Suresh

    yes the max size set to 512.
    ps -ef | grep 11335
    nbkmsfh 21053 831 0 10:19:29 pts/23 0:00 grep 11335
    advboprd 11335 1279 0 Oct 04 ? 134315:58 /usr2/BEA10MP1/jdk150_11/bin/java -server -DWls10=fiedo-admin -Xms256m -Xmx512m
    prstat -L -p 11335 1 1
    $ prstat -L -p 11335 1 1
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
    11335 advboprd 3167M 2908M sleep 4 0 143:52:04 0.4% java/94
    11335 advboprd 3167M 2908M sleep 4 0 60:45:05 0.3% java/318
    11335 advboprd 3167M 2908M sleep 1 0 126:20:00 0.3% java/267
    I see the Heap size occupied , from pmap.
    00010000 64K r-x-- /usr2/BEA10MP1/jdk150_11/bin/java
    0002E000 16K rwx-- /usr2/BEA10MP1/jdk150_11/bin/java
    00032000 56K rwx-- [ heap ]
    00040000 3840K rwx-- [ heap ]
    00400000 258048K rwx-- [ heap ]
    10000000 2359296K rwx-- [ heap ]
    total 3238528K
    -Suresh

  • Using more than one textpds.conf

    I have customer who has several custom applications supported by different developers groups.
    They use a lot of text pluggable data sources.
    Is it possible to use more than one textpds.conf in the same report instance?
    The idea is to avoid that one application deployment does not interfere with the others applications deployed in the same report instance.
    Thanks in advance.

    nope.

  • Using more than one AppController in Cocoa

    I'm developing an extensive Cocoa-Application which requires more than one AppController in Interface Builder (as a subclass of NSObject). Each controller has a special task (MainController, WindowController, PreferencesController, etc.)
    The only thing I don't know is how the controllers can communicate with each other. (e.g. the PreferencesController shoud inform the MainController about some changes in the preferences window, MainController hast to send messages to WindowController, etc.)
    I think there are several ways the do this, but which the most conveniant one?

    Does that mean that I have to wire up all controllers in IB just like I connect an outlet (e.g. an NSTextField) to a controller? In other words: Do you mean that every controller has to contain an outlet of each other controller?
    But only when you need to send messages between them.
    And what about Selectors or NSNotifications? What's the benefit of using these kinds of communication?
    "If it feels good, do it." But then, mostly when it does not break the good OO parts of your code. Sometimes NSNotification or delegation or selectors are the ONLY ways you can get something done. What is important is knowing that all these things are available to you as problem-solvers. You seem to be well on your way to using the Cocoa frameworks. Gute Reise, und viel Glueck!

  • How come you can not use more than 126GB of a 1.5TB diskdrive with LabVIEW Real Time?

    How come you can not use more than 126GB of a 1.5TB diskdrive with LabVIEW Real Time?
    This is only 8.3% of the available disk drive space!
    http://digital.ni.com/public.nsf/allkb/E7E2F5657B6​026358625750B007201A6?OpenDocument
    National Instrument's solution is either reformat you drive to less than 126GB or replace the drive with one less than that size.
    Please NI, tell me you are going to fix your LabVIEW Real Time soon, and that we won't have to wait for LabVIEW RT 9.2.1 in 2011 for this one to be fixed.
    http://upload.wikimedia.org/wikipedia/commons/9/90​/Hard_drive_capacity_over_time.svg
    Drives as large as 126GB or more have been around since about mid 2002.  That's about 7 Years now and LabVIEW Real Time STILL can't use drives larger that 126GB!  Please NI.  Do something.
    We deserve fixes to the old versions of LabVIEW RT.  How about updates to LabVIEW RT.  Such as 7.0.2, 7.1.2, 7.6.2, 8.0.2, 8.2.2, 8.6.2.
    We don't need new features or versions of LabVIEW RT such as 9.0 until we have some of bugs fixed in the existing versions. 
    Kevin. 
    Message Edited by kmcdevitt on 05-29-2009 03:39 PM
    Solved!
    Go to Solution.

    Coq rouge wrote:
    NI is not making the Real Time OS in house. I do not remember which firm that is making it. Anyway you are allowed to use a hard drive that has been partitioned. And 126GB is some space is it not? I remember Bill Gates declared one time that 640Kb ram should be more than enough for any PC application also in the future 
    Coq Rouge (formerly t06afre),
    The RealTime OS is an NI Product that is purchased from NI.
    NI may or may not outsource design, developement, or manufacturing of the products that it sells under its own Company name.
    For this reason I would be concerned if I were a PXI Embedded Controller designer/developer in the United States. 
    Yes, 126GB is some space.  I see that there are now 2TB drives available.  126GB would be 6.3% of a new 2TB drive.  Should we all be happy with being able to use 6.3% of the available drive space.  Moore's Law seams to be alive and well.  Drives larger than 126GB have been readily available for 5 or 6 Years.  This should not be a surprise to NI.  Why don't they do something about it.
    Thanks for the trivia on Bill Gates.  I must have missed that one since I don't try to keep up with Microsoft.  I believe that he is a wonderful person and he and his family are doing wonders for the world in their "retirement".   The world needs more like him.
    What I do remember is Steve Jobs telling us that we would never need more that 128MB and that we would never to need to do anymore software development because everything was already in the "ToolBox".
    McKevin.  

  • Number of Member ID is more than 65535 in a user defined Product Dim

    HI Friends
    I am in a BPC 7.0 MS Version  PLanning  Implementation. The Number of MEMBER ID'S in the PRODUCT DIMENSION  which is  USER DEFINED IS MORE THAN 65535 ROWS.
    Can you please suggest me how can i handle the situation.
    In the Sales Planning i am using PRODUCT DIMENSION WHICH IS USER DEFINED.
    IN THAT DIMENSION SKU OR MATERIAL IS BASE LEVEL MEMBER & ITS PARENT IS MATERIAL GROUP
    And also, in the SAP ECC transactional system, there is change of mastet data in term of
    NEW ADDITION MATERIAL OR SKU
    REGROUPING OF MATERIAL, I MEAN CHANGE IN THE HIERARCHY , LIKE A SKU MOVING FROM A MATERIAL GROUP TO ANOTHER MATERIAL GROUP
    Can you please let me know that is there any way by which i can update the dbo.mbr table for the Product dimension automatically through a SSIS package and if so then how go ahead with it.
    Warm regrads
    Roger
    Edited by: Rthomas on Jan 8, 2010 7:54 AM

    You can use the make dimension task to process dimensions in SSIS. What this does is it selects a table which you import and processes this into the membertable.
    When you use this task, make sure that the table from which you process has the same structure as the membertable.
    I have implemented this for a customer and what I did there was to append the new records to the membertable and process from there and this works fine, but it is also possible to process from another table, but only the members that excist in that table will be processed.
    If you want to only do the changes you can append the new records to the membertable itself and process that.
    For changes in hierarchie you should execute some SQL code to determine which parents are modified and then change the membertable accordingly. This can be done by sql statements and for example you can use the Execute SQL task in SSIS.
    Edited by: Tim Vierhout on Jan 8, 2010 9:39 AM

  • Using more than 2 control points in Interpolater.Spline

    Hello,
    what I'm working on is a bouncing ball, I figured it might work controlling the interpolator to create a multiple control points using the spline. ( a function with x ^n^ , where n is the number of control points)
    In a spline I can use only two control points, is there a way to make it use more than that, or do i have to use another way.
    Thanks for all help.
    Edited by: A.m.z on May 9, 2013 1:49 AM
    Edited by: A.m.z on May 9, 2013 1:49 AM

    Well, I guess it wasn't so hard - at least when there are libraries written by others to borrow from . . .
    This interpolator requires the apache commons math 3.2 lib - you can download commons-math3-3.2-bin.zip from here:
    http://commons.apache.org/proper/commons-math/download_math.cgi
    Extract commons-math3-3.2.jar from the zip and put it on your class path.
    This interpolator differs a little from the Interpolator.SPLINE interpolator that comes with JavaFX.
    Instead of control points which bend the curve but do not lie on the curve, the interpolator takes a set of points and plots a curve of best fit directly through the points.
    import javafx.animation.Interpolator;
    import org.apache.commons.math3.analysis.interpolation.SplineInterpolator;
    import org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction;
    public class BestFitSplineInterpolator extends Interpolator {
      final PolynomialSplineFunction f;
      BestFitSplineInterpolator(double[] x, double[] y) {
        f = new SplineInterpolator().interpolate(x, y);
      @Override protected double curve(double t) {
        return f.value(t);
    }Here is an example usage:
    import javafx.animation.*;
    import javafx.application.Application;
    import javafx.scene.* ;
    import javafx.scene.paint.*;
    import javafx.scene.shape.*;
    import javafx.stage.Stage;
    import javafx.util.Duration;
    public class BestFitSplineDemo extends Application {
      private static final Duration CYCLE_TIME = Duration.seconds(7);
      private static final int PLOT_SIZE = 500;
      private static final int N_SEGS    = PLOT_SIZE / 10;
      public void start(Stage stage) {
        Path path = new Path();
        path.setStroke(Color.DARKGREEN);
        final Interpolator pathInterpolator = new BestFitSplineInterpolator(
          new double[] { 0.0, 0.25, 0.5, 0.75, 1.0 },
          new double[] { 0.0, 0.5,  0.3, 0.8,  0.0 }
        // interpolated spline function plot.
        plotSpline(path, pathInterpolator, true);
        // animated dot moving along the plot according to a distance over time function.
        final Interpolator timeVsDistanceInterpolator = new BestFitSplineInterpolator(
            new double[] { 0.0, 0.25, 0.5, 0.75, 1.0 },
            new double[] { 0.0, 0.1,  0.4, 0.85, 1.0 }
        Circle dot = new Circle(5, Color.GREENYELLOW);
        PathTransition transition = new PathTransition(CYCLE_TIME, path, dot);
        transition.setInterpolator(timeVsDistanceInterpolator);
        transition.setAutoReverse(true);
        transition.setCycleCount(PathTransition.INDEFINITE);
        transition.play();
        // show a light grey path representing the distance over time.
        Path timeVsDistancePath = new Path();
        timeVsDistancePath.setStroke(Color.DIMGRAY.darker());
        timeVsDistancePath.getStrokeDashArray().setAll(15d, 10d, 5d, 10d);
        plotSpline(timeVsDistancePath, timeVsDistanceInterpolator, true);
        stage.setScene(
          new Scene(
            new Group(
              timeVsDistancePath,
              path,
              dot
            Color.rgb(35,39,50)
        stage.show();
      // plots an interpolated curve in segments along a path
      // if invert is true then y=0 will be in the bottom left, otherwise it is in the top right
      private void plotSpline(Path path, Interpolator pathInterpolator, boolean invert) {
        final double y0 = pathInterpolator.interpolate(0, PLOT_SIZE, 0);
        path.getElements().addAll(
          new MoveTo(0, invert ? PLOT_SIZE - y0 : y0)
        for (int i = 0; i < N_SEGS; i++) {
          final double frac = (i + 1.0) / N_SEGS;
          final double x = frac * PLOT_SIZE;
          final double y = pathInterpolator.interpolate(0, PLOT_SIZE, frac);
          path.getElements().add(new LineTo(x, invert ? PLOT_SIZE - y : y));
      public static void main(String[] args) { launch(args); }
    }Edited by: jsmith on May 11, 2013 5:58 AM

  • Mac pro with 16GB RAM for CS3? CS3 cant use more than 3 GB? why

    hi
    does it make any sense to buy 16GB RAM for a mac pro
    only for working with CS3?
    i am retouching prof. and in the moment we run CS2 on the mac pro.
    later CS3 is in the pipeline.
    we ordered 16GB RAM in order to work with HDR images and big file sizes coming from hasselblad h2 and h3 (300dpi, 23 x 23inch, round 50 or 100 layers, filesize 1 - 2GB per image.)
    thanks

    found this article @ adobe website
    thanks for your help!
    "When you run Photoshop CS3 on a 64-bit operating system, such as Mac OS X v10.4 and later, Photoshop can access up to 8 GB of RAM. You can see the actual amount of RAM Photoshop can use in the Let Photoshop Use number when you set the Let Photoshop Use slider in the Performance preference to 100%. The RAM above the 100% used by Photoshop, which is from approximately 3 GB to 3.7 GB, can be used directly by Photoshop plug-ins (some plug-ins need large chunks of contiguous RAM), filters, and actions. If you have more than 4 GB (to 8 GB), the RAM above 4 GB is used by the operating system as a cache for the Photoshop scratch disk data. Data that previously was written directly to the hard disk by Photoshop is now cached in this high RAM before being written to the hard disk by the operating system. If you are working with files large enough to take advantage of these extra 2 GB of RAM, the RAM cache can increase performance of Photoshop.
    The default RAM allocation setting in Photoshop CS3 is 70%. These settings should be optimal for most users. To get the ideal RAM allocation setting for your system, change the RAM allocation in 5% increments and watch the performance of Photoshop in the Activity Monitor. You must quit and restart Photoshop after each change to see the change take effect.
    The available RAM shown in the Performance preferences has already deducted an amount that is reserved for the operating system from the total RAM in your computer. You shouldn't set the percentage of RAM to be used by Photoshop to 100% (unless you are using more than 2G of RAM) because other applications which run at the same time as Photoshop (for example, Adobe Bridge CS3) need a share of the available RAM. Some applications use more RAM than you might expect. For example, web browsers can use 20-30 MB of RAM, and music players can use 20-50 MB of RAM. Watch the Activity Monitor to view the RAM allocations on your computer.
    Watch your efficiency indicator while you work in Photoshop to determine the amount of RAM you'll need to keep your images in RAM. The efficiency indicator is available from the pop-up menu on the status bar of your image or from the Palette Options on the Info Palette pop-up menu. When the efficiency indicator goes below 95-100%, you are using the scratch disk. If the efficiency is around 60%, you'll see a large performance increase by changing your RAM allocation or adding RAM."

Maybe you are looking for