Differences between -Xss[size] in linux and windows

Simple thread test program which runs 3000 threads:
startup options on windows:
-server -Xms16m -Xmx16m -Xss7k
startup options on linux:
-server -Xms16m -Xmx16m -Xss97k (Why 90k bigger stack size??)
Linux is using newest kernel and NPTL threads. With 'regular' threads the linux version overflows stack unless -Xss2m is given...
I Think Sun needs to come up with clear specification of threading models, libraries etc... used in both environments. If you search these forums - one of the most common and baffling error is the sig11 on linux. I think the main cause behind it are the library 'mismatches'.
Answers to these questions are really needed:
What is the recommended threading library on linux with each VM version?
Against which library is the VM tested?
If anyone has experiences with NPTL threads on 1.4.2 VM please contribute. How many threads did you manage to create, how much memory that took? What distribution, thread library, start up parameters, etc... did you use.
I'm going to do a bit more experimenting on a real life application during the followin weeks. With simple test program we were able to create over 16000 threads, but if you do the math with the minimum stack size you can guess that the virtual memory usage was sky high!
P.S.
I'll post more exact platform specs when I'm back to work tomorrow..

http://java.sun.com/docs/hotspot/VMOptions.html - see under -Xoss option.
BTW, I ran my test case again, and now i finally succeeded to prove that 'rule' (see that 'another' thread): Xss*nThreads + Xmx < Xmx_MAX. The conclusions are (at least under 32-bit Linux):
1) Xss does limit native stack size
2) the 'rule' seems to be independent of whether u r actually using the allocated stack space or not
Below a test case is attached. Under 32-bit Linux it crashes before it can create 30 threads with
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at testlab.StackTest.main(StackTest.java:46)exception, if start up parameters are
java -cp ../../classes -Djava.library.path=./ -Xms1870m -Xmx1870m -Xss1m testlab.StackTest 100 200 1000000The crash point can be moved/eliminated by modifying either Xss param (the smaller the size the later the crush would happen) or Xmn/Xmx (the smaller...., the later....). Exact Xmx_MAX number might depend on what threads library you are running. On my hardware it is as follows:
java -Xms1920M -Xmx1920M
Error occurred during initialization of VM
Could not reserve enough space for object heap
java -Xms1910M -Xmx1910M
Error occurred during initialization of VM
Could not reserve enough space for card marking array
java -Xms1900M -Xmx1900M
<RUNS OK>See how error messages differ. So, in the case above Xmx_MAX is around 1.9G.
Native code was compiled with gcc2.96, under 32-bit RH Linux, no optimizations.
Java code compiled with 1.4.2_02 compiler, run with JVM is 1.4.2_02
Java file:
package testlab;
* Author: volenin
* Date: Dec 4, 2003
* Time: 10:40:20 AM
* under GPL license
public class StackTest extends Thread {
  static byte[] arr;
  static {
    System.loadLibrary("stacktest");
  boolean isStarted = false;
  int allocSize;
  StackTest(int allocSize) {
    this.allocSize = allocSize;
    setDaemon(true);
//    arr2 = new byte[allocSize];
  public void run() {
    isStarted = true;
    allocate(allocSize);
    synchronized (this) {
      try { wait(); }
      catch (InterruptedException Ie) {}
  public native void allocate(int size);
  public static void main(String[] args) throws Exception {
    int nThreads = Integer.parseInt(args[0]);
    int allocSize = Integer.parseInt(args[1]);
    int initSize = Integer.parseInt(args[2]);
    arr = new byte[initSize];
    for (int i = 0; i < nThreads; i++) {
      int n = i+1;
      System.out.println("Creating thread #"+n);
      StackTest test = new StackTest(allocSize);
      System.out.println("Starting thread #"+n);
      test.start();
      System.out.println("Thread started #"+n);
      synchronized (StackTest.class) {
        if (!test.isStarted)   StackTest.class.wait(100);
      System.out.println("Thread running #"+n);
Native .h file:
#include <jni.h>
#ifndef _Included_testlab_StackTest
#define _Included_testlab_StackTest
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT void JNICALL Java_testlab_StackTest_allocate(JNIEnv *, jobject, jint);
#ifdef __cplusplus
#endif
#endif
Native .cpp file:
#include "testlab_StackTest.h"
JNIEXPORT void JNICALL Java_testlab_StackTest_allocate(JNIEnv *env, jobject jobj, jint allocSize) {
  int arr[allocSize];
  int arrSize = sizeof(arr);
  printf("array allocated: %d, %d\n", allocSize, arrSize);
  getchar();

Similar Messages

  • I converted video into frames. There is a big difference between video size(700 MB) and All frames s

    I converted video into frames. There is a big difference between video size(700 MB) and All frames size(More than 5 GB). What are the reasons ?

    Please, are you sure that you posted this in the correct forum? This is the Adobe Captivate forum, not a forum for video created with other applications like Premiere Pro.
    Lilybiri

  • What is the difference between Microsoft Speech API Dsktop and Windows Runtime versions?

    There is a text-to-speach funtionality on Windows Desktop and on Windows RT and Windows Phone. I want to know what is the difference of TTS APIs (SAPIs)?

    Hi TIKSN,
    Based on your description, it seems that you want to know the difference of the TTS APIs among the Windows Desktop and Windows Store/Phone app. If so in Windows Desktop it uses this
    System.Speech.Synthesis APIs to implement the text-to-speech function. But in Windows Phone Runtime and Windows Store 8.1, it uses the
    Windows.Media.SpeechSynthesis APIs to implement the text-to-speech function.
    For the difference between the "Windows.Media.SpeechSynthesis" and "System.Speech.Synthesis", please try to check the reply which posted by @Rob Caplan - MSFT in here:
    http://stackoverflow.com/questions/25710852/what-are-the-different-between-windows-media-speechsynthesis-and-system-speec
    If I have misunderstood you, please feel free to let me know.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Essbase system 9 -difference between the installation in UNIX and windows

    Hi,
    plz let me know the difference in installation in UNIX and windows, let me know the process. this is bit ugent...
    advanced thanks for your help and support.
    Thanks,
    sudhakar

    Hi Sudhakar,
    You have 2 documents for windows_installation and unix_installatio in the following location.
    http://download.oracle.com/docs/cd/E10530_01/doc/nav/portal_1.htm
    Sandeep Reddy Enti
    HCC
    http://analytiks.blogspot.com

  • Is there a difference between microsoft office for mac and for windows?

    As a college student it's important that everything is equal for windows and mac for using instructions. So i am wondering if theres a difference between microsoft office for mac and for windows?

    There are differences between the two version of Office. If you need to be exactly like the Windows version, you will have to run Windows on your Mac.
    Allan

  • Difference between text size in General setting and  large type in Accessibility settings

    Difference between text size in General settings and large type in Accessibility settings?

    None that I can see.

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • Connect as sysdba between Linux and Windows without using password

    hello
    Hello
    I need to connect as sysdba between Linux and Windows without using password for the sys user
    Sqlplus /@string_connection
    Plz help me

    Duplicate post:
    Connect as sysdba between Windows and Linux
    Actually you have been given the answer in your above thread. You need to read the Oracle documentation. Search password file at tahiti.oracle.com
    regards

  • Different stringWidth between Linux and Windows

    When I use Ms Windows Arial Font in my Java Program running on Linux
    I found out the rendering result of the Font is different with same program running on Windows
    The Arial Font in Linux become wider, and this cause problem because i used absoule position.
    I am using Java 1.3.1, How can solve this problem??

    The Arial under Linux and Windows are not the same. Firts, they may be different font files, second, both systems uses different rendering engines to draw them. Also, some systems, as mine, won't have Arial font at all - substitute font will be used then. So, I would expect, you will have similar problems with any other font, any other operating system or even in some specific locales which uses reversed (right-to-left) line ordering. You will also be not able to do internationalization properly.
    Simply your application is not portable and written with breaking may portability rules. I hope, you are not doing it for money. The layout managers is the only existing aswer to your problem. The closest to absolute is a SpringLayout introduced in 1.4.x.
    The absolute location problem is not a bad thing in Java only - it can screw C, VisualC and CBuilder applications. Take some of them and tweek your system settings - use large fonts for buttons, tiny fonts for menu, change whatever OS provides you to be able to change in L&F and look what will happen with some of those applications. I would be really happy to have layout managers in CBuilder.
    regards,
    Tomasz Sztejka.

  • Oracle DB sessions on Linux and Windows

    Actually I am confused the way session memory is allocated on 32 bit windows and linux OS.
    Windows is a thread based architecture where all user sessions are treated as threads of oracle.exe process. The addressable space is 4GB and oracle.exe can use up to 3GB in case you use /3GB switch in boot.ini file. It means that combined size of SGA ,PGA and other memory structures can not be more than 3GB. When a session gets connected with a database a PGA is allocated. It means that memory required by database sessions also comes from the 3GB limit. If your memory usage goes beyond 3GB you wont be able to connect new sessions with database or you would require to reduce the size of one of your SGA components.
    Linux is a process based architecture where each user session is treated as a separate process and has its own addressable space. Even on 32bit linux the addressable space is 4GB i.e. 2GB for process and 2GB for kernel. It means we need to accommodate our SGA and PGA in the 2GB limit (there are ways to increase the size of SGA but let assume we are doing nothing to raise the 2GB limit).
    As PGA is allocated for every session when it connects with database.
    My question is how PGA memory is allocated against a database session on linux.
    To further clarify my question I am stating the results of an experiment that I did on linux and windows.
    On windows I set the total size of SGA to 1730M and PGA aggregate target to 1024M. I was able to able to startup the database instance without any issue. Then I started connecting sessions with the database and even ran a query doing a heavy sort in one of the sessions but after connecting 10 sessions with DB I started getting ORA-12500 TNS Listener failed to start a dedicated server process error on windows.
    Then I did the same experiment on Red Hat Linux. SGA size was 1633MB and where as PGA aggregate target was only 10MB. I was unable to start instance when I set the SGA size more than 1633MB.
    With that setting I was able to connect more than 200 sessions with database inspite of running query doing heavy sort in 4 sessions without getting ORA-12500 error. I was even able to connect more than 400 sessions with database after setting PGA aggregate target to 1GB on Linux.
    Now my confusion is why linux was able to handle more DB sessions. I know it’s a process base model and each session is a separate process and has its own addressable space but as PGA is allocated against every session and PGA memory comes from 2GB limit then why PGA memory did not exhaust on linux. Is PGA allocated differently on linux as compared to windows?

    Perhaps the problem is easier to understand if you leave PGA_AGGREGATE_TARGET out of this issue completely.
    The out of memory problem you had, has nothing to do with PGA_AGGREGATE_TARGET setting directly. The difference in number of processes comes from architectural differences in how Oracle uses memory in windows vs unix.
    On windows the SGA + ALL PGAs must fit into one 4GB address space (in practice even smaller as youve noticed). This is because there's only one process, oracle.exe. One process = one address space.
    On Unix, you have many processes and every process can use portion of their own address space for PGA.
    So, on windows (32bit) you run out of address space for the single oracle.exe process. On unix you dont hit this limit just because the number of processes grows (but if some process wants to use a lot of PGA memory, then they eventually run out of address space (talking about 32bit again))
    On unix you probably ran into another limit - amount of total usable virtual memory (RAM+swap) available in your system
    Tanel Poder
    http://blog.tanelpoder.com

  • Difference between ALC Forms ES module and ALC Output ES module

    Hi,
    I would like to know if anyone has implemented just the Adobe Output ES module in any of the projects.
    I am into a project where we are integrating ALC with one of the insurance application for document generation and correspondence generation.
    Confused whether to go with Forms ES module, Output ES module or both?
    Can someone please throw light on these modules? I know there is info on the website but would like to know the advantages and disadvnantages of using either one of the module or both?
    If just Output module is used how will the insurance application interact with ALC?

    Jianghuai,
    The link you have gotten from Ivan provides great information sources.
    Note that those are not four different distributions, meaning linux-based operating systems, all are RHEL -- check out the FAQ, items 1 and 2. I would say main differences between family members are licensing and support offerings or subscriptions. AS, ES for "server" and WS, Desktop for the "desktop".
    "ES is licensed for servers with up to 2 CPUs and 16GB of main memory while AS is licensed for servers of any size and any architecture."
    Oracle products are generally not supported on the desktop variants.

  • CD different for Linux and Windows

    I have in hand a very strange CD. This is an (old) CD with drivers for a Samsung printer. The CD has drivers for Linux and Windows. But if I mount the CD in Linux, I see only the Linux driver and if I access the CD from Windows, only the Windows drivers are seen. How they can do that ? How can I mount in Linux the CD in order to see the content seen from Windows ?

    In Windows ( DIR D: )
    Le volume dans le lecteur D s'appelle SAMSUNG_LBP
    Le numéro de série du volume est C432-A954
    Répertoire de D:\
    28/02/2005 00:53 <REP> ACROBAT_READER
    26/10/2004 06:11 740 AUTORUN.INF
    28/02/2005 00:53 <REP> DATA
    28/02/2005 00:53 <REP> ML-1610
    28/02/2005 00:53 <REP> Manual
    09/12/2004 03:55 11 219 SETUP.DAT
    20/09/2004 07:29 270 336 SSAuto.Dll
    17/09/2004 08:03 253 952 SSEtc.dll
    22/09/2004 11:09 225 280 SSFcs.dll
    12/03/2004 05:59 1 622 016 SSRes.dll
    17/09/2004 08:04 155 648 SSTtp.dll
    26/10/2004 05:42 307 200 Setup.exe
    28/02/2005 00:54 <REP> USB
    8 fichier(s) 2 846 391 octets
    5 Rép(s) 0 octets libres
    In linux (ls -l -F /mnt/cdrom)
    total 44
    dr-xr-xr-x 22 root root 4096 Feb 28 2005 Manual/
    -r--r--r-- 1 root root 2555 Feb 28 2005 README.txt
    -r-xr-xr-x 1 root root 51 Feb 28 2005 autorun*
    dr-xr-xr-x 3 root root 2048 Feb 28 2005 bin/
    dr-xr-xr-x 8 root root 2048 Feb 28 2005 cups/
    dr-xr-xr-x 4 root root 2048 Feb 28 2005 data/
    dr-xr-xr-x 3 root root 2048 Feb 28 2005 help/
    -r--r--r-- 1 root root 8517 Feb 28 2005 icon.xpm
    dr-xr-xr-x 9 root root 2048 Feb 28 2005 locale/
    dr-xr-xr-x 2 root root 6144 Feb 28 2005 misc/
    dr-xr-xr-x 3 root root 2048 Feb 28 2005 ppd/
    dr-xr-xr-x 2 root root 2048 Feb 28 2005 scripts/
    dr-xr-xr-x 4 root root 2048 Feb 28 2005 setup.data/
    -r-xr-xr-x 1 root root 6603 Feb 28 2005 setup.sh*
    ouput of isoinfo -d dev=dev/sr0 (in linux)
    CD-ROM is in ISO 9660 format
    System id: LINUX
    Volume id: SAMSUNG_LBP
    Volume set id:
    Publisher id:
    Data preparer id:
    Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
    Copyright File id:
    Abstract File id:
    Bibliographic File id:
    Volume set size is: 1
    Volume set sequence number is: 1
    Logical block size is: 2048
    Volume size is: 239152
    Joliet with UCS level 3 found.
    SUSP signatures version 1 found
    Rock Ridge signatures version 1 found
    Rock Ridge id 'RRIP_1991A'
    If I use on Windows the Windows port of cdrtools; then these tools behave as in Linux, showing me the Linux contents. In Linux I can also mount -t udf and then I see:
    total 32
    -rw-r--r-- 1 root root 32768 Feb 28 2005 Desktop DB
    -rw-r--r-- 1 root root 0 Feb 28 2005 Desktop DF
    drwxr-xr-x 1 root root 22 Feb 28 2005 Manual/
    This was for a Samsung ML-1610 B/W laser printer. This is crazy.
    @lolilolicon That explain the result when I mount -t hfs. But the difference in Linux and Windows remain mysterious. How Windows "mount" the CD? I believed it was the equivalent of mount -t iso9660 in Linux but apparently, it is not.
    Last edited by olive (2011-09-08 12:12:16)

  • Running jar in Linux and Windows

    Hi
    I created a jar file in Linux and it is running fine under Linux.
    But when I tried to run the same jar under windows,I got the following error
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Is there any difference between running jar files in Linux and Windows?

    Hi
    I have a jar(say program.jar) containing a program which uses some libraries(again some jar files).The manifest file is written to look for the library jar files in the current directory.
    Main-Class: package_name.program_name
    Class-Path: fits.jar image.jar util.jar myutil.jar
    But while running the jar file in WINDOWS (java -jar program.jar <parameter list>)
    the following error occurs:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    nom/tam/fits/Data"
    the class Data is present in the fits.jar jarfile.
    The same jar(run in the same manner)does not give any problems in Linux

  • How to set owner-only access file permissions both on Linux and Windows

    Hi everybody.
    I have the following problem. I need to store some private user information in file system. So I need to set owner-only access permissions for some directory in user home. I did not find API for doing this. As I understand this is platform specific thing. Could anybody tell me how can I do this both on Linux and Windows?
    Thank you in advance.

    More ideas just came back to me (of something I did before)
    Each OS requires a different control.
    For Windows you will need to set the .policy file for each user (a pain if you have more than a dozen of clients) granting access (R or RW) to files/directories.
    Then you have to write some native code (access via JNI) to access/modify your authorization.
    A more professional solution that I used was J-Integra (other similar tool exist).
    Basically it is a bridge between Java and COM. It magically give you access to the COM API from Java (and vice versa).
    In my case it was to read/write/modify Winword documents transfered between PC and server.
    From memory you have to run the com2java.exe to build the bridge (classes in Java language) between the 2 families. Compile those classes and you have a "driver" for the COM (Microsoft Objects).
    Here I must confess my ignorance on Microsoft.
    Those COM objets must give you some easy/integrated access to the API for LDAP or Microsoft Active Directory Service (for centralize control with more complex setup).

  • What is the difference between the 4th generation ipad and the ipad 3 with retnia display?

    What is the difference between the 4th generation iPad and the "New iPad with retina display"? i don't quite understand. are they stilll the same size or would i have to get a different case?

    The 3rd and 4th generation iPads are the same size. The 4 has a faster processor, and a little better iSight camera for FaceTime. The 4 also has the lightning connector so your old cable will not work with the iPad 4.
    You should always check with the manufacturer of the case to see if it will fit. You can probably do that on the manufacturers website.
    This might be of some interest to you.
    http://www.zdnet.com/ipad-4-teardown-pretty-much-the-same-as-the-ipad-3-70000068 33/

Maybe you are looking for

  • ITunes Library Dilemma

    Okay I have a small situation I would like to resolve....here's the 411 on what happened: My 4 year old Dell laptop is running low on space so I recently purchased an external 500 GB hard drive. I did it primarily to copy all of my important informat

  • Creation of invoicing plan while creating the PO using BAPI_PO_CREATE1

    Hi, basically I'm creating a PO using BAPI_PO_CREATE1 and then creating Invoicing plan thru ME22 using BDC. Could anyone please help me if there is any possibility of creation of invoicing plan while creating the PO itself using BAPI_PO_CREATE1. than

  • HOW DO I CREATE AN APPLE ACC. WITHOUT HAVING A CREDIT CARD?

    i just want an account with no credit in it!!! please help!

  • Hazzle to create a DVD?

    I have a Sony CyberShot wich can record video+sound (MPG). I have a Powerbook G4Ti with QT Pro and and a Iomega Super DVD burner + DVD+R 16x discs. I want to burn DVDs from my small MPG-films, but I don't know how. Can someone give me a step-by-step

  • APP & ITUNE in Japanese!!!

    I just got my new iphone 3G. I was gettin' some new applications but it's in Japanese. I read some discussions about this problem so I tried out few things such as downloading new applications which worked but soon it changed back to Japanese. If I s