WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   fps performance caused by garbage collection? (https://forum.worldviz.com/showthread.php?t=1542)

Mike Konstant 06-27-2008 08:14 AM

fps performance caused by garbage collection?
 
Dear Vizard Users,

I am a new user to this group so appoligize in advance if I break protocol.

I am running a virtual reality simulation under Vizard Development Edition 101-89172709 Version 3.00.2701. The simulation works fine most of the time however once and a while the frame rate drops from 60fps down to 20-30ftps with no direct association with the users actions. Has anyone experience such intermittent performance? Can anyone suggest what approach should be taken to trackdown such a problem? More details of what I am facing is given below, for anyone interested;

The computer system is a NVIDIA NFORCE 680i LT SLI Intel Pentium III (2GB RAM) motherboard with a GeForce 8800 GTX card.

The python program running the simulation is multi-threaded. The simulation has static and dynamic objects in the environment. Below is a description of some testing I performed.
Test 1.
Ran simulator from IDE without the dynamic objects; no fps problem
Ran simulator from IDE with the dynamic objects; fps problem after 5 min
Test 2.
Repeated Test 1. Same results
Test 3.
Reset computer
Repeated Test 1. Same results.
Test 4.
Repeated Test 1, but also
Ran simulator from IDE again with the dynamic objects; no fps problem
Test 5.
Ran simulator from ouside IDE without dynamic objects; no fps problem
Ran simulator from ouside IDE with dynamic objects; no fps problem

As illustrated above, replicating this problem is a challenge and I can only guess that it may be cause by memory problems and perhaps related to garbage collection? Could this be a hardware issue? Any insight related to such symptoms would be greatly appreciated.

My current course of action is to eliminate portions of the simulator code until I get a configuration where the fps never drop. I hope I'm lucky and isolate the rogue code responsible for consuming the CPU time and causing the frame rate to underperform. (By the way, I have tried changing the vizard.exe priority to real-time, that just crashes the simiulator)

Mike

farshizzo 06-27-2008 02:46 PM

What do you mean by 'dynamic' objects? Are you creating objects at runtime? Are you sure the slowdown is caused by the CPU? When the frame rate drops does the update time increase? Also, have you tried disabling the other threads to see if they are causing the slowdown?

Mike Konstant 07-04-2008 09:14 AM

Dynamic, update, threading?
 
The environment that is being simulated has dynamic vehicles moving on a road. The slowdown is caused by lack of CPU time, most likely due to our custom code in the simulator.
Regarding the update time, it is usually 5-6 and jumps up when the frame rate drops.
Further testing that I have done shows that by excluding the moving objects in the simiulation and removing file saving via a thread the problem seems to go away. My question now is what is the most effecient way to save data while a user is exploring in the enviromnent. Currently a Python thread saves the data, is there a method to do background processing withing the API that keeps the fps as high as possible?

Mike

farshizzo 07-07-2008 11:44 AM

Is your thread looping as fast as possible and writing data? If the thread is not a high priority then try inserting some time.sleep() statements to give other threads a chance to run.

Mike Konstant 07-11-2008 11:02 AM

I have recently dropped the thread in place of a Director() call that save the data to a file. This improves the performance slightly, however I still notice a drop of performance from 60fps to 53fps. Is there a way to set the priority of the Director() call, to a low priority so the thread takes it time to save the file (save the file over a couple seconds as opposed to < 1 second). Adding numerious time.sleeps() does not seem to be a clean way to reduce the priority.

farshizzo 07-14-2008 11:37 AM

Due to the nature of threading in Python it is not possible to set the priority of a thread. At this point adding sleep statements is probably the easiest solution. Is your file saving thread performing a lot of calculation or is it mostly writing to file? Are you writing data in small or large chunks?

Mike Konstant 09-08-2008 12:29 PM

Just for some closure, I have avoided using a thread to save data to the file system and used the director function to handle saving. This improves performance slightly. The problem originates from somewhere else. Someone else might be posting to "Vizard 3.0 Software" regarding this issue.

Thanks for the assistance.

billjarrold 09-03-2012 12:44 PM

We have been experiencing a similar intmittent slowdown problem.

We have been been privately corresponding with worldviz about the issue.

There is a profiling module that may help identify sources of computational load.

If there is a garbage collection problem maybe an idea is to reduce e amount of virtual memory available. Does anyone know how to do this? One idea is to start up a bunch of extraneous non-vizard resource hogging processes and see if that makes the intermittent slowness problem worse. Is there a better way to reduce the amount if memory available? Is this garbage collection etiology a valid approach/hypothesis?


All times are GMT -7. The time now is 07:46 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC