IO performance of multithreaded app

In a multithreaded app there are N threads. These threads produce some data and write to disk. The data is written on disk in following two ways:
1. Each thread is writing data to a different file.(All files are on same disk)
2. All threads write data to a single file.
After running some tests the results show that 2nd case takes 20% more time than 1st.
I want to know the actual reason the this, whether there is some parallel io happening, or some other reason.
Vinit.

Hi Vinit,
Assuming that you have set thread councurrency level to a proper value, a simple reason is that writing to a file involves locking the corresponding inode. So if all your threads are writing to the same file , there is a chance that the LWPs corresponding to your user threads sleep inside the kernel for the lock on the inode . This will reduce the performance.
BTW , you didn't give your machine configuration ..
Thanks,
Prajeesh

Similar Messages

  • Multithread App !

    Hi Friends,
    I have a multithreaded app that refers stock price and suggest end user upon the availability, as of now it was running as a Swing app. we are thinking of porting it on web. So how can a end user access this Stock price screener using webservices ?
    Here are my challenges :
    1. I cannot deploy it in J2ee Webserver as they are managed environment.
    2. We have not yet migrated to jdk1.6 ( WE WILL DO THAT NEXT YR DEPENDING HOW THE PRODUCT IS PERFORMING)
    So how can this be acheived in a strict(ideal) j2ee environment.
    My boss is strict about J2ee standard, I donot know how to implement this in budget n time ??
    I am really scratching my head about the same for an hour n so I have not find a decent answer on web also. Is it that violting the basic rule of j2ee is the only way out. ("don't sponge a thread in a managed environment" ). I know there are software that are running thread with in like log4j but they have special grant to run not my application.
    thks.s.das

    EJP wrote:
    I would have failed you in the interview for the garrulous verbosity of writing Boolean.TRUE.equals, which can be completely omitted, and Boolean.FALSE.equals, which can be replaced by !.Students learn what in the books, and lot of java books I see using the same style:
    http://books.google.com/books?id=DXYZZVlWOAkC&pg=PA286&dq=Boolean.TRUE.equals%28&hl=en&sa=X&ei=i31sT8jdJonh0QH01-jyBg&ved=0CDIQ6AEwAA#v=onepage&q=Boolean.TRUE.equals%28&f=false
    http://books.google.com/books?id=ppNBCdxxW5AC&pg=PA439&dq=Boolean.TRUE.equals%28&hl=en&sa=X&ei=i31sT8jdJonh0QH01-jyBg&ved=0CD8Q6AEwAg#v=onepage&q=Boolean.TRUE.equals%28&f=false
    Here is more serious mistakes, looks like the book author doesn't understand the difference between Boolean and boolean, Integer and int:
    http://books.google.com/books?id=FPxif81mgYoC&pg=PA219&dq=Boolean.TRUE.equals%28&hl=en&sa=X&ei=i31sT8jdJonh0QH01-jyBg&ved=0CDgQ6AEwAQ#v=onepage&q=Boolean.TRUE.equals%28&f=false
    When you code wrong, you make something wrong for your application, When you teach wrong, you make lot of wrongs .... :D

  • What are the performance implications moving apps using cloud drive to Azure File Services?

    I run a number of cloud services with 5 or more nodes in using cloud drives. Cloud drive is scheduled to be deprecated in 2015. So I am thinking of replacing the cloud drive with Azure Files service.
    For each cloud service I am using one storage account to create all the the VHD/cloud drives. Some people at the time when cloud drive first appeared, told me that to get better performance, I should create only one VHD/Cloud Drive
    under only one storage account. For example, if I have five instances under a worker role then I should create 5 storage accounts and create one VHD/Cloud Drive under each storage account to be used by each node. I didn't follow that route because I was satisfied
    with the performance of the apps under cloud services having all VHD/Cloud Drives under one storage account.
    My question is, if I replace cloud drive with Azure file services, will my apps perform well having all shares under one storage account or create one storage account for each share?
    Thanks,
    @nazik_huq

    Thanks Obama for replying.
    Here is the comment from @jaiharidas of MSFT if anyone's interested:
    @Naziq, It is better to have multiple shares under single storage account and there is no perf implications. However, please ensure that your ingress/egress and request/sec is within
    the limits of a single storage account (seemsdn.microsoft.com/.../dn249410.aspx)
    and use multiple storage accounts if you need to scale beyond the limits.
    See the original comment  on Azure Storage Team here: http://ow.ly/ChPNf 
    @nazik_huq

  • Transactions in Multithreaded app

    Is it safe to use the same java.sql.Connection instance all over multithreaded app? Is transaction session associated with a thread? Or one Connection keeps just one transaction session for all threads?
    Any help's appreciated.

    Is it safe to use the same java.sql.Connection
    instance all over multithreaded app?Yes, providing your access/uses is thread safe, i.e. syncronised.
    Is transaction
    session associated with a thread?No a connection.
    Or one Connection
    keeps just one transaction session for all threads?Yes.
    A transactions should be autonomous, if all threads use the same transaction, it would be pointless using transactions in the first place.
    Any help's appreciated.Checkout these link, your should
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/bmp.html
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jdbc.html
    http://developer.java.sun.com/developer/technicalArticles/xml/metadata/

  • How can I improve the performance of my app?

    Hi,
    I have written an java application. This app makes a large number of calls on a method getting a value from an array. Profling the app reveals that it spends more than 90% of the time in this call. Because the app makes so many calls to this method the app isnt running as fast as it should!!! Can someone tell me how I can improve the performance of the app? Are there any techniques that I can use to improve the performance?

    paul_b wrote:
    I have written an java application. This app makes a large number of calls on a method getting a value from an array. Profling the app reveals that it spends more than 90% of the time in this call. Sounds like you should optimise that call. Either change the code in the call so it is faster or call it less often.
    Because the app makes so many calls to this method the app isnt running as fast as it should!!! It will run faster if you get it to do less work, if it is doing only the work it should do then that is how fast it is.
    Can someone tell me how I can improve the performance of the app? Are there any techniques that I can use to improve the performance?Optimise the code, call it less often, use a server or servers with more resources/CPU.

  • OAF page : How to get its query performance from Oracle Apps Screen?

    Hi Team,
    How to get the query performance of an OAF page using Oracle Apps Screen ??
    regards
    sridhar

    Go through this link
    Any tools to validate performance of an OAF Page?
    However do let us know as these queries performance can be check through backend also
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • SIGSEGV in multithreaded app with OCI( on Linux

    I have got a SIGSEGV in OCI9. Application is multithreaded.
    OS Linux. Distribution SLES8. Libc version 2.2.5.
    Oracle 9.2.0.5
    Application is heavy multithreaded. SIGSEGV occures very rarely. But always in the same place.
    Connect code:
    static void oracle_init() {
    ILock l(m_env);
    if (counter++ <= 0)
    (void)OCIInitialize(OCI_DEFAULT, 0, NULL, NULL, NULL);
    ctor {
    oracle_init();
    (void)OCIEnvInit(&env, OCI_DEFAULT, 0, NULL);
    (void)OCIHandleAlloc(env, (void **)&err, OCI_HTYPE_ERROR, 0, NULL);
    connect {
    checkerr(err, OCILogon(env, err, &ctx, (text *)const_cast<char *>(user.c_str()), user.len(), (text *)const_cast<char *>(password.c_str()), pass
    word.len(), (text *)const_cast<char *>(db.c_str()), db.len()));
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(nlolgobj+0x50f) [0x4044a22d]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(nnfun2a+0x243) [0x403bc7e3]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(nnfsn2a+0x66) [0x403bc310]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(niqname+0x18a) [0x40365a1a]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(kwfnran+0x11f) [0x402d5df7]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(kwfcinit+0x177) [0x402a9155]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(kpuatch+0x834) [0x4014f7d2]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(kpulon+0x1bc) [0x4015009e]
    /u/app/oracle/product/9.2.0/lib/libclntsh.so.9.0(OCILogon+0xd1) [0x401e2167]
    Any ideas? Maybe I should initialise OCI with other flags?

    OCIInitialize should be called with mode OCI_THREADED instead of OCI_DEFAULT.

  • Getting Timeout Error when running web performance Webtest using App-Insights

    Hi All,
    I have created web performance test using VSTS 2013. When I am running this test using App-Insights (Azure Version) I am getting error "Web Test exceeded the configured timeout (00:02:00) and was aborted." In webtest property I set timeout limit
    is 300 Sec. still webtest is timeout in 2 min. Kindly let me know Is this problem of App-Insights (Azure Version) or webtest?
    Regards,
    Sandip

    Sandip, Application Insights (both the Azure and VSO versions) override the timeout internally to a max of 2 minutes. No web tests in AI can run for longer than 2 minutes.
    This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

  • Firefox3 slow performance with APEX apps

    Hi all,
    I've been using Firefox 3 to develop an APEX app (my first). Today, I see that every time I navigate in an APEX form (e.g. Next or Prev row), the HD light on my laptop's docking station glows for a second. After some snooping, I see that FF3 uses a local SQLLite DB to capture URL history. The glowing light makes sense, since each Next/Prev click on the form changes the URL to include the new value for the primary key of the form's underlying table -- new URL, new write to the history. And since SQLLite reportedly syncs every write to disk, I get a glowing HD light with every form nav click.
    Anyone else noticed this rather annoying behavior? Any thoughts on resolving (other than switching browsers!)?
    TIA,
    Rich

    Hi John,
    You must be using a different version of Google -- I didn't see that one! It turns out that I had my FF3 kept history cranked to 90 days, like I had in FF2. Only now there's apparently a huge performance penalty for that setting.
    The plugin worked, as dropping the history time apparently did a "DELETE FROM" instead of a "TRUNCATE...DROP STORAGE" and the SQLLite DB was still &gt;25MB. The plugin's compact function dropped it to 240KB and now my APEX navigation is back to acceptable performance.
    Just what I need -- yet <em>ANOTHER</em> high-maintenance database ala SQL Server that I need to take care of! :_|
    Thanks!
    Rich

  • Performance of Pro apps on MacBook Retina?

    I am thinking of upgrading to a MacBook Pro Retina Display.
    My main concerns are with the fact that  first versions of everything arenet running that well, so is it worth it to change to retina display for pro uses such as Final Cut Pro Studio, not FinalX and CS 5 and 6 suites? with out crashes and others? I know that mountain lions is to heavy for the MacBook Pro, and the mail identity cannot be sent from Snow Leopard to Mountain Lion.

    I'd say; save yourself the trouble and stick to Snow Leopard.  It's a **** of a lot faster than what comes after and you don't run the risk of losing all your pro apps.  I had a MacBook Pro 17" from early 2011, which was the last version on which they had OSX Snow Leopard, but it got stolen and when I bought a new one, being a late 2011 version, it already had OSX Lion pre-installed.  Which means you can't downgrade, due to some hardware modifications, to OSX Snow Leopard and I had to buy EVERYTHING again!  Simply because OSX Lion is incompatible with the software I had before.  Pro Tools didn't work anymore, Cubase didn't work anymore and everything else just takes hours in comparisson to OSX Snow Leopard.  Stability and performance both went down with the newer OSX's.

  • Is this graphs are for normal performance or the app leaking the memory ?!!

    Hey there,
    I'm new to java profiling and testing and I faced some hang ups so i made some fixes to my code .
    It's medium sized application and i captured some shots of the Memory Heap, Memory GC, Threads/Loaded classes Graphs From NetBeans Profiler.
    If any one may see them and say if this is normal performance or I need some more fixing in the come.
    Note that the graphs are captured when I was doing Load Test on the program
    The Memory Heap Graphs
    http://islamelhosary.mufix.org/profiler/3.png
    http://islamelhosary.mufix.org/profiler/4.png
    http://islamelhosary.mufix.org/profiler/7.png
    The Memory GC Graphs
    http://islamelhosary.mufix.org/profiler/2.png
    http://islamelhosary.mufix.org/profiler/5.png
    http://islamelhosary.mufix.org/profiler/8.png
    The Threads/Loaded classes Graphs
    http://islamelhosary.mufix.org/profiler/1.png
    http://islamelhosary.mufix.org/profiler/6.png
    http://islamelhosary.mufix.org/profiler/9.pngThanks for your time
    Islam El Hosary

    It's always hard to tell if memory is leaking by graphs alone... of course if your memory graph is always increasing and never returning to some base value after GC, then you probably have a leak. You should use a tool like JProfiler on your app server to watch for leaks from a particular application (object within some app). But, in general... watch all graphs Memory, Threads, and CPU usage for abnormal trends. An app can also leak via over usage of resources (spawning threads that are never completing or never released).

  • JDO Logging with MultiThreaded apps

    I am having a HUGE problem w/ JDO displaying every SQL INFO statement to
    the screen. I have my log4j.properties file setup as follows
    log4j.rootCategory=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.SQL=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.JDBC=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.Schema=ERROR, console
    log4j.category.com.solarmetric.kodo.Performance=ERROR, console
    log4j.category.com.solarmetric.kodo.MetaData=ERROR, console
    log4j.category.com.solarmetric.kodo.Enhance=ERROR, console
    log4j.category.com.solarmetric.kodo.Query=ERROR, console
    log4j.category.com.solarmetric.kodo.Runtime=ERROR, console
    log4j.appender.console=org.apache.log4j.ConsoleAppender
    And this works fine for a single threaded application, however if that
    application spawns any threads, those threads write everything imaginable
    to the screen, as though I had everything in my log4j.properties set to
    =INFO.
    This is really, really annoying for debugging purposes, I have no idea
    where to go with this
    And yes my kodo.properties file has multithreaded=true
    I am also using JUnit to run these tests, FYI
    Thanks in advance for any help

    We are spawning these threads within our application and we see the same
    behavior when launched from the command line.
    Here is my logging.properties:
    # Specify the handlers to create in the root logger
    # (all loggers are children of the root logger)
    # The following creates two handlers
    handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
    # Set the default logging level for the root logger
    ..level=ALL
    # Set the default logging level for new ConsoleHandler instances
    java.util.logging.ConsoleHandler.level=ERROR
    # Set the default logging level for new FileHandler instances
    java.util.logging.FileHandler.level=ALL
    # Set the default formatter for new ConsoleHandler instances
    java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    # Set the default logging level for all Kodo logs to ERROR
    com.solarmetric.kodo.impl.jdbc.SQL.level=ERROR
    com.solarmetric.kodo.impl.jdbc.JDBC.level=ERROR
    com.solarmetric.kodo.impl.jdbc.Schema.level=ERROR
    com.solarmetric.kodo.Performance.level=ERROR
    com.solarmetric.kodo.MetaData.level=ERROR
    com.solarmetric.kodo.Enhance.level=ERROR
    com.solarmetric.kodo.Query.level=ERROR
    com.solarmetric.kodo.Runtime.level=ERROR
    Here is my log4j.properties:
    log4j.rootCategory=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.SQL=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.JDBC=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.Schema=ERROR, console
    log4j.category.com.solarmetric.kodo.Performance=ERROR, console
    log4j.category.com.solarmetric.kodo.MetaData=ERROR, console
    log4j.category.com.solarmetric.kodo.Enhance=ERROR, console
    log4j.category.com.solarmetric.kodo.Query=ERROR, console
    log4j.category.com.solarmetric.kodo.Runtime=ERROR, console
    log4j.appender.console=org.apache.log4j.ConsoleAppender
    And yet, I still get this output( from just a few seconds of runtime)
    sed=209;params={(long)21102}]
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=643;size=10;max
    =70;hits=632;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=643;size=10;max=70
    ;hits=632;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=210;params={(long)21103}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=644;size=10;max
    =70;hits=633;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=644;size=10;max=70
    ;hits=633;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=211;params={(long)21104}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=645;size=10;max
    =70;hits=634;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=212;params={(long)22155}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=211;params={(long)22205}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=213;params={(long)22156}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=212;params={(long)22206}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=214;params={(long)22157}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=213;params={(long)22207}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=215;params={(long)22158}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=214;params={(long)22208}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=216;params={(long)22159}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=215;params={(long)22209}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=655;size=10;max=70
    ;hits=644;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=212;params={(long)21105}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=656;size=10;max
    =70;hits=645;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=656;size=10;max=70
    ;hits=645;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=213;params={(long)21106}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=657;size=10;max
    =70;hits=646;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=657;size=10;max=70
    ;hits=646;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=214;params={(long)21107}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=658;size=10;max
    =70;hits=647;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=658;size=10;max=70
    ;hits=647;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=215;params={(long)21108}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=659;size=10;max
    =70;hits=648;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=659;size=10;max=70
    ;hits=648;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=216;params={(long)21109}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=660;size=10;max
    =70;hits=649;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=217;params={(long)22160}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=216;params={(long)22210}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=218;params={(long)22161}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=217;params={(long)22211}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=219;params={(long)22162}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=218;params={(long)22212}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=220;params={(long)22163}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=219;params={(long)22213}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <18423897>:
    [re used=221;params={(long)22164}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:14008569; T:26117441; D:23582715 ] executing statement <10141941>:
    [re used=220;params={(long)22214}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=670;size=10;max=70
    ;hits=659;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=217;params={(long)21110}] Jun 30, 2003 3:35:20 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 15ms Jun 30, 2003
    3:35:20 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=671;size=10;max
    =70;hits=660;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]]
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 11.157 sec Jun
    30, 2003 3:35:21 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=671;size=10;max=70
    ;hits=660;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:21 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=218;params={(long)21111}] Jun 30, 2003 3:35:21 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:21 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms Jun 30, 2003
    3:35:21 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] return
    [com.solarmetric.datasource.
    PoolConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dat
    asou
    rce.PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595
    8617
    ,wrapped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=672;size=10;max
    =70;hits=661;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0
    to [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3 ; taken=2]] Jun 30, 2003 3:35:21 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] get
    [com.solarmetric.datasource.Poo
    lConnection@19da967[identityHashCode:16658781,wrapped:com.solarmetric.dataso
    urce
    ..PreparedStatementCache$CacheAwareConnection@19da967[identityHashCode:595861
    7,wr
    apped:oracle.jdbc.driver.OracleConnection@19da967]:
    [requests=672;size=10;max=70
    ;hits=661;created=11;redundant=0;overflow=0;new=11;leaked=0;unavailable=0]]]
    fro m [com.solarmetric.datasource.DataSourceImpl$SortablePool[min=3; max=10;
    size=3; taken=1]] Jun 30, 2003 3:35:21 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] executing statement <2622421>:
    [reu sed=219;params={(long)21112}] Jun 30, 2003 3:35:21 PM
    com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] begin rollback
    Jun 30, 2003 3:35:21 PM com.solarmetric.datasource.DataSourceImpl log
    INFO: [ C:27109735; T:26117441; D:23582715 ] end rollback 0ms
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    Are you spawning the threads, or is JUnit forking off to start the
    threads?
    I suspect that you are using junit to create the threads, and the
    classpath that the junit task is seeing does not have log4j.properties in
    the classpath.
    Can you ensure that the log4j.properties file is in the classpath that the
    threads that are logging are using?
    Alternately, configure the apace commons logging framework to use their
    built-in simple logger and configure the simple logger via its
    system-properties-based configuration capabilities.
    -Patrick
    On Fri, 27 Jun 2003 20:56:39 +0000, Damian Bradicich wrote:
    I am having a HUGE problem w/ JDO displaying every SQL INFO statement to
    the screen. I have my log4j.properties file setup as follows
    log4j.rootCategory=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.SQL=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.JDBC=ERROR, console
    log4j.category.com.solarmetric.kodo.impl.jdbc.Schema=ERROR, console
    log4j.category.com.solarmetric.kodo.Performance=ERROR, console
    log4j.category.com.solarmetric.kodo.MetaData=ERROR, console
    log4j.category.com.solarmetric.kodo.Enhance=ERROR, console
    log4j.category.com.solarmetric.kodo.Query=ERROR, console
    log4j.category.com.solarmetric.kodo.Runtime=ERROR, console
    log4j.appender.console=org.apache.log4j.ConsoleAppender
    And this works fine for a single threaded application, however if that
    application spawns any threads, those threads write everything
    imaginable
    to the screen, as though I had everything in my log4j.properties set to
    =INFO.
    This is really, really annoying for debugging purposes, I have no idea
    where to go with this
    And yes my kodo.properties file has multithreaded=true
    I am also using JUnit to run these tests, FYI
    Thanks in advance for any help--
    Patrick Linskey
    SolarMetric Inc.

  • IOS worse performance when other apps in background OS

    Hello,
    I have seen this asked before. I notice my application is not quite as smooth when other apps are alive in the background of iOS.
    I am guessing it's simply running low on ram and there is nothing i can do about it? I am rendering in GPU
    if i close some or all, it runs fine.

    I think the problem is this: when doing parallel DML, Oracle uses direct path reads to read the data. To make sure the data being read is consistent though it needs to checkpoint blocks it is going to read. CR enqueue seems to be used to synchronize CKPT with PX slaves reading the data. It's going like this: PX slave requests CKPT to checkpoint a range of blocks it's about to read (and possibly enqueues on CR in order to be able to do so,) CKPT in turn orders DBWR to write all dirty blocks in the requested range, waits for this write to complete and signals PX slave that the blocks are consistent and can be read. Repeat as necessary. Now, with really large buffer cache and good portion of it dirty due to recent DML on source tables, busy CPUs and relatively slow writes this checkpointing might build up into a major performance inhibitor when these recently touched tables are being read in direct path mode: you have 8 cores and 8 parallel slaves, so CKPT, DBWR and pretty much all other background processes are competing with them for CPU time and I/O bandwidth (they all have the same priority, so your PX slaves can easily evict CKPT or DBWR from CPU only to immediately go back to sleep on an enqueue held by a process it just preempted.)
    Things to try here:
    1. do a checkpoint before running the insert and see if this makes any difference;
    2. lower the degree of parallelism to 5-6;
    3. If you have more than one DBWR configured - configure db_writer_processes back to 1.

  • What are the main things to do when optimizing the performance of Java App

    what are the main things to do when optimizing the performance of Java App

    what are the main things to do when optimizing the performance of Java App

  • JNI_CreateJavaVM fails in Multithreaded app.

    Hello,
    when i call JNI_CreateJavaVM in a multithreaded application, I ll get the error:
    "ERROR: Could not find the pthread library (2). Are you running a supported Linux
    distribution?"
    So, given the following program, everyhing works okay:
    ----code---
    #include "jni.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <pthread.h>
    void jnicall()
    JNIEnv *env;
    JavaVM *jvm;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jclass stringClass;
    jobjectArray args;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString = "-Djava.class.path=.";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    if (res < 0) {
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    cls = env->FindClass("Hello");
    if (cls == NULL) {
    goto destroy;
    mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
    if (mid == NULL) {
    goto destroy;
    jstr = env->NewStringUTF(" from C!");
    if (jstr == NULL) {
    goto destroy;
    stringClass = env->FindClass("java/lang/String");
    args = env->NewObjectArray(1, stringClass, jstr);
    if (args == NULL) {
    goto destroy;
    env->CallStaticVoidMethod(cls, mid, args);
    destroy:
    if (env->ExceptionOccurred()) {
    env->ExceptionDescribe();
    jvm->DestroyJavaVM();
    int main()
    jnicall();
    ---code---
    But when I replace main with something like
    ---code---
    int main()
    pthread_t thread;
    if (0 != pthread_create(&thread, NULL, (void*(*)(void*))jnicall, NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    Really strange is that is does not matter, how i use pthread functions: even if
    i call the jnicall function directly from main but start a different thread using
    pthread_create, i get this method too:
    ---code---
    int main()
    pthread_t thread;
    jnicall();
    if (0 != pthread_create(&thread, NULL, (void*(*)(void*))some_other_thread_without_jni,
    NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    My system is a Suse Linux Enterprise Server 8.0 (wth United Linux 1.0) (kernel
    2.4.19, glibc is 2.2.5); the Jrockit stuff is JRockit 8.1 SP 2
    Any ideas?
    TIA,
    Johannes

    Try checking that the environment variable LD_ASSUME_KERNEL=2.2.5 is not
    set.
    From the release notes at:
    http://edocs.bea.com/wljrockit/docs81/relnotes/relnotes.html#1041981
    Best Regards,
    Josefin Hallberg
    BEA WebLogic JRockit
    Customer Centric Engineering
    "Johannes Hampel" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hello,
    when i call JNI_CreateJavaVM in a multithreaded application, I ll getthe error:
    "ERROR: Could not find the pthread library (2). Are you running asupported Linux
    distribution?"
    So, given the following program, everyhing works okay:
    ----code---
    #include "jni.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <pthread.h>
    void jnicall()
    JNIEnv *env;
    JavaVM *jvm;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jclass stringClass;
    jobjectArray args;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString = "-Djava.class.path=.";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    if (res < 0) {
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    cls = env->FindClass("Hello");
    if (cls == NULL) {
    goto destroy;
    mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
    if (mid == NULL) {
    goto destroy;
    jstr = env->NewStringUTF(" from C!");
    if (jstr == NULL) {
    goto destroy;
    stringClass = env->FindClass("java/lang/String");
    args = env->NewObjectArray(1, stringClass, jstr);
    if (args == NULL) {
    goto destroy;
    env->CallStaticVoidMethod(cls, mid, args);
    destroy:
    if (env->ExceptionOccurred()) {
    env->ExceptionDescribe();
    jvm->DestroyJavaVM();
    int main()
    jnicall();
    ---code---
    But when I replace main with something like
    ---code---
    int main()
    pthread_t thread;
    if (0 != pthread_create(&thread, NULL, (void*(*)(void*))jnicall,NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    Really strange is that is does not matter, how i use pthread functions:even if
    i call the jnicall function directly from main but start a differentthread using
    pthread_create, i get this method too:
    ---code---
    int main()
    pthread_t thread;
    jnicall();
    if (0 != pthread_create(&thread, NULL,(void*(*)(void*))some_other_thread_without_jni,
    NULL))
    fprintf(stderr, "Cannot create thread");
    exit(1);
    ---code---
    My system is a Suse Linux Enterprise Server 8.0 (wth United Linux 1.0)(kernel
    2.4.19, glibc is 2.2.5); the Jrockit stuff is JRockit 8.1 SP 2
    Any ideas?
    TIA,
    Johannes

Maybe you are looking for

  • Will MS Office Standard 2011 for MAC 32-bit work on my MacBook Pro which is 64-bit?

    Will MS Office Standard 2011 for MAC 32-bit work on my MacBook Pro which is 64-bit?

  • I have 0 songs in my iCloud/iTunes Match account and it says exceeded limit. How do I fix?

    Hard drive crashed and when I loaded my local songs back into iTunes it wouldn't recognize my library. So I deleted all songs from iCloud to start anew. Now it will not allow me to add anything into my iTunes Match account.   I have deleted the libra

  • Sort files automatically to specified folders...?

    I am trying to find a way in which I can drag and drop a file onto a folder so that upon doing so, the file is automatically placed within a sub-folder of that folder based on its file type...To clarify, I have a folder on my desktop called 'Misc Stu

  • Quotes in SQL data

    Hello all, I have implemented a SBO solution with a customer and transeferred all legacy data. However all data in the item masterdata received quotes at the beginning and end of every itemname. For instance, if the DTWB excel template stated : screw

  • Null Cipher/Identity Alias

    I am using Keytool provided by J2SE. Is there any way to create a "identity" key pair. Basically you put in Unciphered text run the routine and you get back out Unciphered text. This is just for testing purposes. Any help, even a point in the right d