Out of memory! while loading .X file

Hello, I have a large .X file… almost 600,000 polygons - about 50MB in size.

When I try to load it into my panda script using the code below, it starts loading, working hard, and after 30 seconds or so, it says “Out of memory!”

environ = loader.loadModel("mba/models/v3o.x")       
environ.reparentTo(render)

I opened up task manager to see if I could watch what was going on, and sure enough, idle memory usage was at about 1.5 GB. When I started the script, it grew, and grew, and grew, till it hit 3.5 GB, then gave me the error and crashed.

The system has 8GB of RAM and is running Windows 7 x64. Does Panda3D not support 64bit processing?

Also… on a somewhat related matter. Everytime I load a .X file, it says "Unable to open X file: " but always loads anyways, so I’ve been mostly ignoring it.

Any thoughts?

The Panda build for Windows provided here is a 32-bit build, so it cannot access more than 2 to 4 GB of RAM. It is possible to build a 64-bit Windows build of Panda, but we don’t presently do this by default.

You might get better results by pre-converting your x file to egg format with the x2egg command, then loading the egg file. If you can’t load the egg file either, try pre-converting the egg file to bam format with the egg2bam command.

David

Aha, thanks for the heads up. Unfortunately, when I try to run the x2egg converter, it runs “out of memory” too. Just my luck!

Does the Debian or Ubuntu Panda3D build contain 32-bit limitations? I might consider setting up a system if not.

Thanks!

Second update:

I was able to create an egg and a bam on a auxiliary Mac OS system. The egg seemed to load just fine in Windows, although when watching the task manager, it hit almost 3.6 GB… so I think it may have just barely made it!

Any chance a Windows 64-bit version might be released sometime soon? Or would you be willing to point me in the right direction of compiling one on my own?

Thanks again for your help!

I am sorry to hijack this thread but why is it that we do not have a 64bit pre-compiled package?

To compile a 64-bit Panda on your own, you will have to assemble 64-bit versions of all of the thirdparty libraries. Then you can just use the 64-bit Python to run makepanda, and it will build a 64-bit version.

As far as I know, the only reason we don’t prebuild a 64-bit Windows version is that no one has done this yet. If you’d like to be the one to collect together all of the appropriate libraries, I bet we could get a 64-bit build going pretty easily. We’d have to ask rdb’s opinion on it, though; he’d be the one responsible for making the actual build.

David

I’ll look into that when I get some more free time.

64-bits Windows? It’s a considerable amount of work. I’ve attempted it once, but after a lot of struggling I found that the build was very unstable (crashed unpredictably), and I decided that it wasn’t worth all that effort and gave up. It’s not high on my priorities because Windows is designed to run 32-bits applications without problems.

As for 64-bits Mac OS X, there are more problems. Apple has removed several APIs in the 64-bits SDK of Mac OS X, which means that we’d need to rewrite whole parts of Panda’s OS X support (breaking compatibility with older versions which do not have these APIs, such as Tiger).

Really? I wonder why it was so troublesome. For the record, we build 64-bit Windows Panda here at WDI, and it builds without any problems using makepanda, and the resulting build is rock-solid stable. And it is very nice to be able to load large egg files without worrying about that silly 3 GB limit. :slight_smile:

It’s true that OSX has its own set of problems.

David

does linux have issues also? or is it just mac that has problems.

Linux 64-bit is fine. We already provide several of those in prebuilt versions.

David

Thanks for all your helpful responses! I still haven’t been having good luck…

Some .X files won’t even convert to egg in Mac OS X.

I’ve tried importing things into blender and exporting the eggs right out of Chicken exporter, but for some reason that results in huge eggs that Panda won’t open, and egg2bam won’t convert (not even on my Mac).

Guess I’ll be doing some research on either building a 64-bit Windows version or running Linux!

I’m not sure what you are creating but maybe another solution would be to decrease the poly count, thus reducing the size of the file. I’m not sure if you can do that but it might be something to look into

It is more likely that there’s a bug in x2egg, resulting in infinite recursion or something like that, rather than the .x file actually requiring gigabytes of memory.