Can we limit number of CPUs seen by a JVM/Java programs?

We have a Java application which is licensed in several tiers for a number of CPUs (i.e. 1 for trial, 4 and unlimited CPUs for supported version of different cost).
If the application is not provided with a supported license and is executed on multiprocessor hardware, it complains and aborts.
When we tried this application on a Solaris server, we made a zone with a single CPU thread as a dedicated processor, and the application worked.
Now we are trying to set up a trial version on a developer's Windows CoreDuo notebook, and since there are two cores the trial version barks and aborts.
Can we use some JVM feature to force it into seeing and using only a certain number of CPUs, smaller than the number of available hardware CPUs (or at least reporting that number to the java apps)?

You can set the processor affinity to the process you are interested in. Just go to "Task Manager" and click the processes tab, highlight the process you care about and right click it, then select "set affinity" menu and bind that process to the processor you want. This requires you to have the process running first, if that does not work for you, you can write a launcher which calls SetProcessAffinityMask call provided for Windows (see http://msdn.microsoft.com/en-us/library/ms686223(VS.85).aspx for details) and then launch the java process. This works since process affinity is inherited by any child process or newly instantiated local process based on the MSDN documents.

Similar Messages

  • Can I use a C/C++ xml parser in my java program?

    Hi,
    How can I use a C/C++ xml parser in my java program?
    Elvis.

    You would still need to convert the XML data structure into a Java data structure to import it into Java.
    Don't assume you need C++ to do anything. I woudl write it in Java first, then profile the application to see where the bottle necks are and then optimise them
    Don't optimise code unless you have proof it needs to be optimised.
    If you want to improve the speed of reading XML, try XMLbooster

  • Can LabVIEW variables be used like those found in a Java program?

    I created a decoding program in Java that reads in a certain number, or code, and returns the decoded version of that number.
    I tried initially to create this program inside of LabVIEW itself but was hindered by my lack of familiarity and knowledge of what LabVIEW can and can't do and how to approach the problem in LabVIEW.
    My stumbling blocks in LabVIEW seem to be the arrays and working the variables. I'm probably approaching this completely wrong, more than likely because I'm trying to think in Java rather than LabVIEW. 
    Any help that can be given is most appreciated. Also I have attached a text document with my Java code in it. It's not perfect but it works.
    If I need to clarify anything just ask.
    Once again thanks for any help in advanced.
    Solved!
    Go to Solution.
    Attachments:
    Decoder.txt ‏5 KB

    In LabVIEW the wire is the variable. The way you pass parameters to functions (subvis) is with a wire through the connector pane. Same for returning results.
    Forget that local variables exist! A lot of new programmers that come from a text based programming background discover the LabVIEW local and global variables way too early. Like duct tape they can be useful. But it is possible to write huge complex applications without touching them. And the code is much simpler than programs of less complexity that make extensive use of locals and globals.
    Since you are new to LabVIEW you can become a very good programmer if you keep the following in mind. It is a little confusing but "local variables" and "global variables" are not really variables in labVIEW like they are in Java. The wires are the variables. Those rectangle things you create from controls or indicators are more like a function for that control or indicator. They can not exist without an owning control or indicator. It is unfortunate that they are called variables but they are a relic of the stone ages when code was carved into cave walls.
    =====================
    LabVIEW 2012

  • Can we get file name which we are compiling in java program

    Hi,
    I want to know if we can get filename(when compiling) or jarfile(when running) which we are compiling in the program itself.
    EX:java -jar myjar.jar
    How can I display jar file(i.e myjar.jar) in my program
    ex:sop("file which compiled is:"<filename>);

    can you rephrase the question in english, please!!

  • Can I limit number of connections to an application?

    I want to set up a stream targeted an an audience on a single computer in Samoa.  Plan to build my web application to limit who has access by IP address but I'd also like to limit the number of streams on this custom application to just 1 connection.  I can see xml tags in application.xml that support bandwidth caps but I must be missing the obvious way to cap the number of streams.
    Thanks in Advance!

    Are you just trying to query that information?
    --display application appname users_connected ;--
    Whoops, wrong code.
    display application appname ;
    ^^^ Bummer, I see your problem. There are lots of columns coming out of that. I think you'd have to pipe it to a log file (having set the columns really wide), read the log file, strip out the users_connected column, and go from there.
    You could use the shell command in MaxL to go out to Perl/Grep/VBScript/whatever to go do this, set an environment varibale, and come back into MaxL (assuming that's what you want to do). Other wise just run a simple MaxL to get that number and go.
    Regards,
    Cameron
    Edited by: CL on Aug 24, 2010 11:31 AM
    Edited because I can't be bothered to read the question the first time.

  • How can I limit number of responses to my class registration?

    Hi guys,
    I am running few class registration, each class can take 100 students max. So I would like the web registration form stop taking more entries once 100 people responded attendance. How can I achieve that thanks.

    Hi,
    At this time this is not something we currently support but you can add or vote on feature ideas:
    http://forums.adobe.com/community/formscentral?view=idea
    If you need to add a new idea click "Create an idea" under "Actions" in the top right.
    Thanks,
    Josh

  • How can I find out the name of the folder my java program is in?

    Hi, I'm trying to make a little utitlity that makes a bunch of url shortcuts based on the name of the folder I run the java from.
    i.e.
    I have my executable jar in C:/Someplace/My Folder Name/
    I'd like to be able to double click on the jar and it creates the url shortcuts for me using "My Folder Name" as a parameter.
    I've done the shortcuts bit but can't figure out (=find a tut) how to read the folder name.
    Thanks to anyone who can help!

    import java.io.*;
    import java.net.*;
    import java.security.*;
    public class Attempt {
        public static void main(String[] args) throws IOException {
            System.out.println(new Attempt().getFolder());
        public File getFolder() throws IOException {
            ProtectionDomain domain = getClass().getProtectionDomain();
            CodeSource source = domain.getCodeSource();
            URL url = source.getLocation();
            if (!"file".equals(url.getProtocol())){
                throw new IOException("Code source location not a file:" + url);
            String path = url.getPath();
            //remove xxx.jar from path:
            return new File(path.substring(0, path.lastIndexOf('/')));
    }

  • How can i create a test suite in oracle for a java program

    hi
    i have to create a table for test cases for a java program
    in that my main concentration is on branch statements
    i have problems to choose which fields should be there in my table
    plz let me know if you have nay ideas
    thnx
    regards
    [email protected]

    no idea based on the little or nothing you've posted.
    %

  • How can I limit the number of emails retained on my ipad air?

    How can I limit the number of emails that are retained on my iPad Air?  Because of legal requirements of a long-term project, I cannot permanently delete emails relating to that project from my ISP's mail server.  My gmail account contains over 17,000 emails and, upon setting up my new iPad, and updating to ios 7.1.1, I now have all 17,000+ emails taking up space.  I would like to limit the emails by count as I was able to do on my old iPad running ios 5.1.1 OR to retain them based on date range.  I have not found any instructions on the support discussions or general iPad blogs that allow me to do that.  Any way around this problem?
    I also miss the 5.1.1 mail search feature that allowed me to narrow the search by from/to/subject/all.  Does anyone know if that feature is available using some little-known ios 7.1.1 feature?
    Thanks for your help.

    jlfcba wrote:
    IOS 7.1.1 doesn't show a "days to sync" parameter anywhere in SETTINGS/Mail,Contacts,Calendars/ACCOUNTS/GMAIL Account/ GMAIL Acccount Info.  There is nothing in iTunes relating to such an option either.  So, it seems I'm back to square one.
    If you have a decent mail provider like Microsoft Hotmail or Outlook.com mail it does.
    If you have Gmail it does not.  Quite right. Gmail is rubbish.

  • HT2729 I have limited space on my new ipad. How can I limit the number of songs from my itunes on my imac from going to my ipad when I connect the two?

    I have limited space on my new ipad. How can I limit the number of songs from my itunes on my imac from going to my ipad when I connect the two?

    you can do this by keeping the external hard drive connected and doing the following
    -hold shift key down on computer while opening iTunes and a prompt will appear to choose a library
    -select choose library, iTunes should bring up your explorer windows where you can search for the external HD
    -after you find the external HD find the iTunes folder you just copied to it
    -after opening the iTunes folder look for the file that says iTunes library.itl or if you can't see that extenstion just look for a document looking thing in the iTunes folder that shows up as a database file
    -double click the database file and boom iTunes should load your library without having to copy it to the computer
    PS: do make sure that if you are going to do it this way, make sure that the external HD is connected at all times, because if you don't then you will get exclamation marks next to your iTunes songs
    double PS: if you are unsure how to find out if the iTunes library file is a database file just right click it and choose properties and under the type it should say database file
    hope this helps:)

  • Hi, how can I limit the number of emails I can see on my iPhone 5. Every time in delete one and older email gets added from my live.co.uk account (where I want to keep my 2500 emails) I just don't want many on my phone. Thanks

    Hi, how can I limit the number of emails I can see on my iPhone 5. Every time in delete one and older email gets added from my live.co.uk account (where I want to keep my 2500 emails) I just don't want many on my phone. Thanks

    You can't. Why on earth would you attempt to manage 2500 emails with setting up a folder structure or some means of doing so? Simply keeping them in an single inbox is not realistic, no matter what email client you use.

  • How can I limit the number of rows returned by a select stat

    How can I limit the number of rows returned by a select
    statement. I have a query where I return the number of stores
    that are located in a given area.. I only want to return the
    first twenty-five stores. In some instances there may be over
    200 stores in a given location.
    I know is SQL 7 that I can set the pagesize to be 25....
    Anything similiar in Oracle 8i?
    null

    Debbie (guest) wrote:
    : Chad Nale (guest) wrote:
    : : How can I limit the number of rows returned by a select
    : : statement. I have a query where I return the number of
    : stores
    : : that are located in a given area.. I only want to return the
    : : first twenty-five stores. In some instances there may be
    : over
    : : 200 stores in a given location.
    : : I know is SQL 7 that I can set the pagesize to be 25....
    : : Anything similiar in Oracle 8i?
    : If you are in Sql*Plus, you could add the statement
    : WHERE rownum <= 25
    : Used together with an appropriate ORDER BY you
    : could get the first 25 stores.
    Watch out. ROWNUM is run before ORDER BY so this would only
    order the 25 selected
    null

  • How can I limit the number of ros in TextArea?

    As I turn on the line wrap and having used setRows method,
    I cannot limit the number of rows of the textarea into 2.
    How can I limit it?
    Thanks.

    camickr wrote:
    I give up. You don't know specify requirements and I'm not going to prompt you every 5 minutes for more information.
    due to setText method So this implies that the text comes from somewhere, maybe a database, but the user does not type the text directly into the text area.
    If you define the text area with 2 rows, then the third row will not be visible, so I don't see the problem. Just don't add the text area to a scroll pane and the user will never know the third row is there.[http://i188.photobucket.com/albums/z55/nwoedf/temp/error.png ]
    it demonstrates the problem with excess line
    The third row is still visible even I have used setRow(2).

  • How can I limit the number of emails resident in Apple Mail?

    How can I limit the number of emails resident in Apple Mail inbox?

    jlfcba wrote:
    IOS 7.1.1 doesn't show a "days to sync" parameter anywhere in SETTINGS/Mail,Contacts,Calendars/ACCOUNTS/GMAIL Account/ GMAIL Acccount Info.  There is nothing in iTunes relating to such an option either.  So, it seems I'm back to square one.
    If you have a decent mail provider like Microsoft Hotmail or Outlook.com mail it does.
    If you have Gmail it does not.  Quite right. Gmail is rubbish.

  • Can I limit the number of rows returned on a Select?

    Can I limit the number of rows returned on a Select statement? I would be using JDBC in a Java program.

    Use Java prepared statements with the equivalent of this SQL*plus script:
    VARIABLE n number
    EXEC :n := 3;
    SELECT rownum FROM all_objects WHERE rownum <= :n;
        ROWNUM
             1
             2
             3
    EXEC :n := 5;
    SELECT rownum FROM all_objects WHERE rownum <= :n;
        ROWNUM
             1
             2
             3
             4
             5

Maybe you are looking for

  • OMCA doesn't work

    Hi, I'm trying to create a EM repository, and bump into the following error: Does anybody knows a solution to that? Kind Regards, Gerben Menschaert I also copied the tail of /u01/app/oracle/product/10.2.0/cfgtoollogs/emca/PEPT/emca_2007-03-14_04-30-5

  • SetXPath works in FF2, but not IE7

    consider this XML: ====================================================================== <images> <image name="01.jpg" width="267" height="270"> <caption></caption> <tags> <tag>Family</tag> <tag>Fun</tag> <tag>Fred</tag> </tags> </image> <image name

  • Spotlight won't work after clean install

    I did a clean install of a 10-seat licence of 10.5 server on the primary partition of a Mac Mini. Logged in with the admin account (the only account), I cannot get Spotlight to find anything at all (even searching for something that it should find, l

  • Error installing Adobe Dreamweaver cs6 unhandled excption in PDApp.exe kernalbase.dll

    I am trying to install Adobe Dreamweaver CS6 on to a computer running windows server 2008 R2. I keep getting an error Adobe Applications Manager has stopped working. Under details it has: Problem Event Name: APPCRASH   Application Name: PDApp.exe   A

  • SQL Query to check which datafiles have AutoExtend on?

    I want to turn autoextend off on almost all my datafiles(obviously not on system). Using the Java Enterprise Manager you can visually see which datafiles have autoextend on. I'd prefer to find out using sqlplus which files have autoextend on so I can