Strange Panda behavior...

I have noticed strange Panda behavior while working on my code (discourse.panda3d.org/viewtopic.php?t=3815).

I noticed that when I run this code then it uses more then 300 Mb of my memory (according to Task Manager in WinXP). If I alt-tab to some other application, the memory usage gets below 100 Mb (and later remains at this level, even when I return to the Panda screen again). It doesn’t affect fps also. Why?

Here are some pics:

  1. Before running panda:

  2. After running panda:

  3. After alt-tab:

Another thing: If I start my computer and after the Windows has started I run the code, I get about 100 fps (VSync off in drivers). If I then hibernate the computer, wake it up, and run the code again, I get about 170-180 fps. Why?

  1. After hibernating:

Nobody knows? :frowning:

I’m guessing both of these weirdnesses are due to your graphics driver, not Panda per se.

All sorts of weird things go on inside graphics drivers. Frankly, I wish we had more control over those sorts of weirdnesses, but we don’t.

David

Do you mean that at the moment you see no way to ensure that games runs with highest fps and lowest memory consumption?
(BTW, I use ATI Mobility Radeon X1600, with Catalyst 8.1)

Well, if you’re willing to be flexible in your definition of “highest” and “best”, sure. You can do all sorts of things to improve your frame rate and/or memory consumption.

If you’re asking the question, “My frame rate is X and I want to make it better, what can I do?” we can help you answer that question.

But if you’re asking the question, “Why is my frame rate X and then suddenly jumps to Y after I minimize and restore the window,” well, I have to shrug and say I don’t know, but it’s probably something funny your driver is doing.

I can make some guesses. When you minimize the window, all of your assets get removed from graphics memory. When you restore the window, they all get put back in. It’s possible that your texture memory happened to be arranged in a suboptimal order, so that the graphics card had to jump back and forth across texture memory in order to render your scene, blowing any internal caches. And maybe when it reloaded, it happened to put them back into a more optimal order, so that the caches were better utilized.

But all that happens at a very low level, under the hood from Panda (or from any other middleware graphics engine). We can’t control it. I can’t even guarantee that it will always happen that way–maybe next week, when you minimize the window and restore it, it will suddenly come back with a much worse frame rate.

Also, as to your memory utilization, what you’re seeing is the resident memory, which is different from total memory. When you minimize the application, if you are running on a low-memory machine, then most of the application will be swapped out of main memory to make room for other applications. When you restore the window, then those parts of the application that are currently active will be swapped back in. As you use more of the application’s memory image, more of it will come back in, but the immediate appearance is that your application is reported as consuming less memory in the Task Manager (simply because less of it happens to be resident right now). Don’t be misled–it is still just as big as it was before you minimized it, but now more of it is in your swap file instead of in your RAM chips.

David

Well, what concerns the frame rate, it seems I have found the problem :slight_smile: It has nothing to do with Panda. I use Asus laptop with Core Duo and ATI X1600 with their Power4 Gear+ utility that controls processor speed to save energy. It seems after the normal boot it fails to set the processor clock at maximum speed, and works at lower “office” speed all the time. If I hibernate computer and wake it up, it works fine, and can set correct speed for the processor :laughing: It was a great surprise to me :smiley:
Honestly, I am not sure who is the true culprit: Windows or Power4 Gear+, but the cause of low fps is under-clocked processor. I will try running Panda in fullscreen mode tomorrow, maybe it will help.