Java3d speed collapse caused by other java apps running at the same time

Hi
I am programming a flightsimulator for some months.
The current state is online available (all free, no copyrights)
at http://www.snowraver.org/efcn/efcnsim/index.htm
especially the sample (source) which shows the
behaviour which is the reason for my post is here
http://www.snowraver.org/efcn/efcnsim/page2.htm
My Problem:
When I start the sim while two other java programs
( one is a server running localhost, one is a client )
are running, the speed of the flightsim is very slow,
one frame update takes 3 to 5 seconds.
( 3 java.exe's in task list plus 1 which is the IDE )
When I start the flightsim ALONE, I have 30 to 40 frames per second.
( 2 java.exe's in the task list = the flightsim and the IDE -> no prob here )
That means, the flightsim is about 100 times slower, when
started while the other two apps are running.
BUT the other two applications do almost ***NOTHING***, the
CPU load is 1 or 2 percent.
Of course they have threads running, but all are waiting
for a signal - no thread really consumes CPU power.
Interestingly, when I FIRST start the flightsim and AFTER THIS
start the two other applications, the flightsim
holds 30 frames per seconds without problems, even
though the other applications consume some CPU power
until they have completely started up.
Configurations:
JSDK 1.4.2_1 , 0_2..
Java3D 1.3.1 OPENGL (The DirectX version crashes with D3D device lost)
Win2000,XP CPU 800MHz upto 3 GHz
In my point of view, the java3d thread scheduler makes
some funny decisions when it starts up, which lead
to the order dependent behaviour described above.
My question is, if anyone has some ideas, how I could
get away from this speed collapse.
The problem is caused in native code I guess.
I also could imagine, that it has to do something with
the order in which one creates, attaches and starts
the Canvas3D. (? could produce race conditions)
The flightsim runs in full retained mode. Of course
the CPU work in the behaviours is rather big, because
the ROAM triangulation update (..) is done there
and the triangles are recalculated and passed
( all BY_REFERENCE ).
Or could it have to do something with the memory
consumption ( when all runs, almost all of
the 512MB RAM is taken by the three java.exe's ) ?
Any hints or ideas ?

:) No, Sun does handle it [lol]
I just have tested it on my computer at work
( 3GHz HP compaq, 1GB Ram and a Intel 82865G Graphics
Card with 64MB memory, Windows XP )
and it has worked without problems any way I tried.
( Except for xclusive fullscreen mode, but I guess, the administrators
have deactivated it somehow, so we don't play games at work :)
I couldn't test it under Linux so far, but I think, this will be less
problematic than Windows [usually].
However my current assumption is:
I totally have forgot the [limited] videocard memory.
I suppose, Java3D tries to put all triangle data and all
textures to the videocards memory, so most data processing
then can be passed to it's graphiccard CPU using
OpenGL commands.
Now the flightsim produces a varying amount of (by_reference) triangle data ( a few thousands )
and has some texture maps for the terrain, the sea and other things,
plus indexed triangle data for the planes and ships.
The notebook system, which slows down has an ATI Mobile Radeon card
with only 32MB RAM onboard, whereas the others have 64MB Ram.
An additional pointer to that theory is that I can trigger the slowdown by resizing
the flightsim window, while it is running.
On the notebook, it holds 30fps, until the window exceeds a size of 962*862 pixels.
At this size the speed collapses and goes down to 1 frame update every 4 seconds.
If I make the window a few pixels smaller, the speed of 30fps immediately
is there again.
Therefore I guess, some data passed to the graphic cards memory depends
linearly from the canvas3d's window dimension, and at some limit,
the graphiccard's memory is too small and Java3D changes it's strategy
and performs most calculations on the computer's mainmemory,
which of course is a lot slower.
I'm not very sure about that, I'm just speculating.
Next thing I will try is to disable directdraw for the other two applications,
possibly swing also uses graphicscard memory, when directdraw is enabled.
The solution seems to be clear anyway: The flightsim must examine the system
and set some parameters depending on the machine's capabilities.
Onboard videagraphic ram is one of them. If it's too slow, I start to decrease
the window size and expect to see a sudden increase of speed, as soon as
the rendering can be done by the graphicscard CPU. If this never happens,
I assume no OpenGL accelerator is present on that system. This can be seen as a method
for finding out the amount of videocard memory on a system by trial and error ..?:)
Thanks for your tips, Alain.
I especially have to check out the data sharing class in 1.5.

Similar Messages

  • Help I can only have max. 3 osx apps. open at the same time ?

    Help I can only have max. 3 apps. open at the same time ?
    If I have 3 apps. open, and try to open a 4th. this message comes up :
    The application "Mail" cannot be launched. -10810
    Of cause if I'm trying to open up something else than mail, lets say iPhoto, it will say "iPhoto".
    This is very weird to me, and I'm normally pretty good at solving issues myself, but I'm stuck with this one.
    Please help out

    I've had this quite a lot too. Do you find that under these conditions you can't load a disk image either?
    At first I put this down to Rosetta taking up a lot of resources. I was running OmniWeb with a lot of pages open in the workspaces so I've switched back to Safari until OmniWeb is UB. This morning I read that having Windows file sharing switched on helps to cause this problem. I switched this off, rebooted and ran disk utility to repair disk permissions and I've been running OK since then. I've currently got 13 apps open plus Finder and Widgets. They include 2 bigguns, Eclipse/MyEclipse and Visual Paradigm for UML. It'll probably stop working now I've written that.
    I run a MBP 17 with 2GB memory. My guess is that Windows file sharing does cause problems. I just hope Apple has resolved this in 10.4.7... whenever that is.
    Gareth

  • Java threads. Are they running at the same time?

    Hello everybody. I am implementing a multiagent system in java and at some point in the program i need a specific function (from a specific class) to run at the same time in several "copies". Those functions are communicating with each other with some messages, so as you can understand not running at the same time is a big problem because of this messages.
    Below i am giving you an example of the code i am using. I would like your opinion whether those functions are running parallel or serial. If they are not running parallel what should i do? Any opinion or something that can help me would be perfect. Thanks in advance.
    //my class
    public class Agent extends Thread {
                           public void MinConflicts(Agent array[],int max_moves){//code in here}
    public static void main(String[] args) throws IOException {
                  Agent[] fbi = new Agent[num] //num is inserted by the user
                 //code here
                 for(i=0;i<num;i++){
                         fbi.start(); //starting the treads
    for(i=0;i<num;i++){
    fbi[i].MinConflicts(fbi,max_moves); //running the function that i want to run parallel
    //code here also :)

    What you appear to be doing here is creating an array of Thread references (which I hope at some point gets populated with actual Thread object references!)......because your first loop is wanting to cycle through each array slot starting the referenced Thread. Then the next loop iterates through the array again, this time calling the method for each Thread object.
    Assuming that you do populate the array, what this code will do is start each Thread which, I believe, will start and immediately terminate because run() has not been over-ridden. The second loop winds up calling the method for each Thread in the array. You are actually calling it from the main thread though. So, as previously advised, I think that you will run each method sequentially.
    The direction that I would head with this is to override run() in your agent Thread and have that run() method call the MiniConflicts() method. Then, in your main routine you can do away with the second for loop. The looping start will start all of the individual threads and they will execute the run() method......which in essence will be executing your MiniConflicts method.
    This reply is NOT a total design... I am sure that there are holes to be filled... but I think that will get you headed in the right direction.

  • Can I have 2 java runtime environments at the same time?

    Hi all!
    I wonder if i can have 2 java runtime environments at the same time installed and functional.For example 1.3.1 & 1.5.0.
    And if i can, how can i tell to application1 to use 1.3.1 and application2 to use 1.5.0?
    Thanx in advance
    Costas

    Hi all!
    I wonder if i can have 2 java runtime environments at
    the same time installed and functional.For example
    1.3.1 & 1.5.0.Sure. I have four.
    And if i can, how can i tell to application1 to use
    1.3.1 and application2 to use 1.5.0?By using a startup script that sets the environment variables to the necessary directory (JAVA_HOME etc) and that calls java.exe by fully qualified path name.

  • Two Telnet read VI's running at the same time interfere with each other

    I have a situation where multiple tests must test multiple UUT’s on the same computer. To send commands to and get responses from the UUT's I use a telnet session. The telnet read VI uses a semaphore. Therefore when two separate top level VI's are running, each calling the Telnet read VI, if one Top Level VI is using the Telnet Read VI the other Top Level VI waits for the first one to complete before it can use the Telnet Read VI. This VI is setup for reentrant execution but because of the semaphore it cannot truly be used as a reentrant function. This causes severe problems when trying to communicate with two different telnet sessions simultaneously.
    In the past I have avoided this problem by compiling everything into an executable. Then each Top Level program runs completely independently with no interdependences. However, now I am implementing Teststand and I need to call the same Top Level VI's. I need to be able to get information into them and back out of them from Teststand. This means that I can no longer compile them into stand alone executables. I did compile each top level VI into its own Share DLL thinking that then each top level program would have its own library to call upon. This did not work. Even though both top level programs are compiled into their own DLL there is still interdependency when calling the telnet read VI. One program waits for the other to finish reading from its telnet connection before it can read from its own telnet connection. Since I have to continuously read from the telnet connection, sometimes for up to half and hour, the tests do not function simultaneously. How can I get around this? Is there a solution?
    Josh
    PS The Telnet Read VI I am refering to came with the Internet Toolset package. Attached is a copy of the VI I use to communicat with the UUT's.
    Attachments:
    GUI_Telnet_W-R_Auto.vi ‏64 KB

    Sorry about the confusion.
    The file I attached is in the hierarchy of two separate top-level VI's. The telnet connect is opened once and closed once in each top-level program. The ref number is then passed into and out of the VI that I attached. I use this VI to repeatedly send commands via telnet and wait for the appropriate responses. The telnet read VI is given a read line separator and reads from the telnet connection until it matches the read line separator with a text string read back from the telnet connection. If not match is found it times out and creates an error.
    I am not sure how to provide an example of the overall scheme since the problem occurs when both top level VI's are compiled each into their own shared DLLs. Those DLLs are then call from Teststand and at some points they are both running at the same time on the same computer connected to two different UUT's.
    The question I have is why does one DLL share functions with the other? When one DLL is using the telnet read VI the other DLL waits for the first one to finish with it before it can it use the telnet read VI. If they were both compiled separately each into their own DLL shouldn't they each have their own set of functions to call upon instead of having to share? I know that if the two top-level VI's are not compiled they cannot both execute the same sub-VI at the same time. The only way to get around this is to set the execution property on the sub-VI to reentrant.
    I actually fixed the problem by setting the VI I attached and the Telnet Buffered Read.VI (called by Telnet Read.vi) execution properties to reentrant. However, I am still concerned about two separate DLLs sharing sub-VIs. Why does it do this?
    Joshua

  • Is it possible to have two (2) apps open at the same time???

    How can I have one app open,like FStream listening to a radio station, keep it open and then open a game to play at the same time I am listening??? can this be done some how????
    please let me know.

    Sorry to disappoint but the iPod touch as much as the Iphone 3Gs, cannot peform several task at once( something call background proceessing or multitasking). Somehow apple tends to stay a bit behind in things like allowing the iPod touch to do multitasking specially allowing apps to run on the background. Even though other mobile devices like the palm pre, google android, and other phones do that without any difficulty in peforming those tasks. But let's hope that apple fixes these lacking feature in future software updates... Cause it's time apple to allow for the iPod touch to run applications on the background, if they want to stay in top of technology.

  • In OSB 10,3, a Java Callout runs in the same thread of the Proxy Service?

    Hello,
    a I have a Java Callout within the Proxy Service, request pipeline.
    Does it runs in the same thread of the Proxy?
    If NOT,
    which work manager is the Java Callout pinned to?
    can I set the work manager I want?
    Thank you,
    regards
    F.Costa

    Thanks a lot.
    Pointer to great info.
    However doesn't mention Java Callout threading, nor the documentation does.
    Anybody with a YES or NO, please...
    F.Costa

  • Am I able to. Have two apps open at the same time? Also how do I play music while online browsing?

    Is it possible to use two apps at the same time? For example having Pinterest open and listening to a playlist on YouTube? Or fact checking a "pin" from a site with safari while looking at the actual site?

    You can click and drag on a tab to "tear" it out into a new window. Or you can open a new window by pressing Control+N, or by hovering over "New Tab" in the Firefox menu and then choosing "New Window" from the sub-menu that appears.

  • 2 apps open at the same time

    Can you open another app while one is running without closing the first?
    I thought this was a new feature of 3.0.

    No, you cannot open two apps at the same time. You cannot run apps in the background, except for the iPod app.
    The closest 3.0 feature to this is the notifications function, which pushes app notifications to your iPhone without the app running.

  • How can I record a microphone and software instrument at the same time in Garageband 10.0.1?  It seems I can record one or the other, but not both at the same time?

    I am trying to record a vocal mic and a keyboard (using a software instrument) at the same time using Garageband 10.0.1.  It seems that I can't record the mic input and the software instrument at the same time.  I can record the mic input by itself, and I can record the software instrument by itself (if I don't have a mic input track created), but I can't record them together.
    It seems like this should be an obvious thing to be able to do, but I can't figure out how to make it work.
    Can someone help?
    Thanks,
    Kurt

    Kurt1997 wrote:
    I am trying to record a vocal mic and a keyboard (using a software instrument) at the same time using Garageband 10.0.1.
    you need to "record enable" both tracks:
    http://www.bulletsandbones.com/GB/GBFAQ.html#multitrackrecordinggbv10
    This FAQ entry offers a Minute GarageBand video tutorial
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How do I have two apps open at the same time on full screen?

    As above - I want to work on word and the internet at the same time. I have resized the screens to half but would like them both to be on full screen. I did manage to do this by accident once (I think) so I'm sure it can be done!!

    Lion I think - it's the new mac air?

  • Proper way to exit with a j2ee java app running in the NW70 j2ee engine

    Hello,
    I am working on migrating an app and it's ear from j2ee 6.20 to 7.0. It deploys okay, but when invoked, the j2ee server restarts. Looking at the part that fails, its trying to create a jco connection, which fails and then it catches the failure and does a stack dump and a System.exit(1). It shuts down and restarts at that point. Is System.exit(1) the proper way to exit a java app that is running within the j2ee engine? If it is, is it possible I am picking up the wrong System.exit and need to use an SAP specific one? I inherited the code, but not the IDE it was written with.
    Thanks,
    Paul D. Chamberlain

    Hi,
    Answered my own question. System.exit(1) should not be used. Return works.
    Paul D. Chamberlain

  • Can a Java app run in the background?

    I want to put an app on a server that runs at a certain time of day (probably something like midnight, not sure yet) that just performs a task without any notifications. Is Java suitable for this task?

    You are looking more to run as a service in windows or a damon in Unix. Do a google on "java windows service" and see what comes up. Last I checked there was a JNI structure given to use and step by steps on how to get what you want to happen.

  • Multiple copies of apps open at the same time

    It appears that some documents that have been saved between back-ups are opening from a copy of an app that is saved in Time Machine and not the applications folder.
    In some menus, like in the HP scanner setup, it shows five copies of each app in the "scan to" chooser.
    A little research reveals that the different apps are are stored in Time Machine backups.
    Any ideas or fixes on this one.

    Try ejecting your Time Machine disk and launching the misbehaving apps to see if that persuades them to launch from your internal rather than Time Machine. If the apps don't launch it would probably be a good idea to run Disk Utility and Verify your internal disk and Repair Permissions. If the internal has errors you have to repair it from the Leopard installation disk. After you boot from the Leopard DVD and pick a language pick Utilities > Disk. After you repair the disk repair permissions.
    Booting from the installer DVD forces Time Machine to do a deep traversal so don't be concerned if the first backup after you reboot takes a good long time in the preparing stage.

  • ITunes no longer runs since buying Match. Within ten seconds of opening, it crashes, everytime. Firewall off, latest version of iTunes reinstalled, Windows updates/etc. on, no other software running at the same time. Error-report just says reinstall.

    I can no longer use iTunes whatsoever.
    I'm hoping to get a refund for the $25 wasted on match if my PC isn't compatible. But how the **** do I get iTunes as a whole to stop crashing?
    I'm on Windows 7 with AMD C-50 processor and 2GB RAM, 250GB hard disc.
    Never had an issue with Apple products before today.
    Windows error reporting claims that "an update to iTunes addresses the issue", but not only did I have 10.5.3 already, I went ahead and reinstalled it, too, and the 64bit version just for the **** of it in case that'd make difference. No luck.
    I mean, surely, the fact that this is only happening to me means it is a problem with my system. But I don't suppose its the usual stuff that way, way inexperienced computer users end up on these forums about. No viruses (are there PC viruses that only affect iTunes match? sounds far fetched.) No firewall issues. Not running outdated software. I imagine its my CPU, my hardware, thats just not compatible with Match.
    Anyways. The crash occurs about 20% into the progress bar of gathering info about your library for match. When restarting, it asks to log off and log back in to the itunes store. A few times I was able to do that, by getting to the little X and cutting off match before it could crash (still logging out and logging back in made no difference), but now the speed at which it gets to the 20% and crashes is so fast I can't beat it to it.
    Do you suppose the Apple store at the mall, since I just got a 4S with Apple Care+ might be able to help me, or would there be a fee? I can't afford a new computer right now, and if mine just could never work with match period, might I get a refund?

    How big is your library?  I would recommend the following troubleshooting steps:
    - Backup your library.  Always a good idea before messing with things.  
    - Create a new library.   Refer to this article for details:  http://support.apple.com/kb/HT1589.  This won't delete your old library, you're just creating a new empty one.  Also refer to this article to get back to your old library later.
    - Add a few albums into this new library.  Not everything, just a small sampling, as a test.
    - Activate Match on this new library.  You shouldn't have to re-pay, it should just say "Add Computer" or similar.
    - At this point, Match should run again. With just a few albums it should complete in just a few minutes.
    If iTunes doesn't crash at this point, then likely there's something about your original library that Match doesn't like - what that is I don't know, but at least you'll know it's not your PC.   If iTunes still crashes, then if could be a number of other things, but probably not your library.   My next suggestion (if you haven't already done this) is to uninstall / reinstall iTunes.   If that doesn't work, then my next ideas you won't like.   

Maybe you are looking for

  • This is possible in InDesign CS5.5 using Folio Builder (DPS).

    Hi DPS Experts, I am new to this DPS work flow. I am using InDesign CS5.5. I have the question? This is possible to create the apps for the below mentioned web link. http://www.spanish-real-estate.co.uk/ The website is in joomla and the domain is www

  • Change default location of Ircat?

    On pc. Is there a way to change the default location of the database (Ircat). I noticed it is in my "C" drive. I have a separate partition for data, which is where I would like LR to point the database. Genereally with Adobe products this would be do

  • VB & Java

    Is This possible to integrate a program made in VB with Java. Aur call dll made by vb in Java Please Help Bunty India

  • Why do apps now open all previous files on restarting the app?

    I am careful to close files before I quit an app. I find it very annoying to have all of the previously open files to reopen when I re-open an app. This happens in OS 10.9.5 Mavericks but not in OS 10.6.8 Snow Leopard. Is there any way I can have the

  • Std WF: same workitem creates multiple times

    Hi, 50 to 100 times sending for the same workitem. What could be the problem. In SWEL shows single event triggered and no errors. But in graph Log shows error. In Quality the same workflow working fine but in Dev multiple mails in inbox Thanks in Adv