E1005 - Help

Posted By: William

E1005 - Help - 10/15/10 05:25

I am getting the E1005 out of memory error after loading a series of levels.

I had asked about this error a couple years ago, and thought I beat it but it has resurfaced upon loading sometimes and I'm not sure why.

From the stats panel:

My sys_memory shows around 425MB, while my nexus is about 150MB on average, and the video memory shows at 1GB on average.

I don't believe this is a damaged file as I resaved everything. Almost all my images are .dds, and my models use bones animation, everything's being purged, ect. My computer has 3GB of virtual memory and 2GB of Ram.

So I am wondering, what accounts for the 425MB exactly? And why is this crashing the game?

I tried using bmap_load to save even more image space but that function isn't fully stable nor is the bmap_create one, it will work mostly(maybe 30 image loads) but then it will crash with some weird Directx E2000 errors or in the latter a pointer crash.

I need to know what or how to cut stuff out or dynamically reload in the game so this E1005 does not appear. All my songs and sounds are streamed through FMOD, and the BMAP pointer definitions in my script only account for about 100MB of it. So where is the rest of it coming from? Levels are loaded dynamically out of .wrs files. There is nothing else defined in my scripts but the BMAPs that would take up space.
Posted By: pegamode

Re: E1005 - Help - 10/15/10 08:41

I got the same error some days before ... couldn't neither figure out where it came from nor eliminate it.
Posted By: jcl

Re: E1005 - Help - 10/15/10 09:38

It is unlikely that the resources of a normal game consume all the available memory on a modern PC. When you have no memory left, normally something is wrong either with your game, or with your Windows memory settings.

You can easily find the problem by checking at which moment the error message appears. For instance, when it appears when loading a certain entity, something with that entity might be wrong.
Posted By: William

Re: E1005 - Help - 10/15/10 22:45

If this is true then why does it load this particular level fine over and over again. But when I load another level, then come back to it, it will sometimes give me this error upon loading it and crash the engine?

As well, you still didn't explain how sys_memory calculates it's memory?

And if it is some entity that only gives errors randomly, can the engine at least tell me what entity it failed to load after the crash? After all, I have hundreds of entities, sound, and image files so it is impossible to pinpoint. Especially when the "damaged file" thing does tell you how to make a file work? Do I save it in MED again?
Posted By: Rondidon

Re: E1005 - Help - 10/15/10 23:00

The revenge of the legendary Intense X memory bug, not? ^-^
Posted By: EvilSOB

Re: E1005 - Help - 10/16/10 00:52

Does it oNLY crash after loading another level? Or does it sometimes crash on its own?

It may be that these "other" levels are not being completely 'released' when you
load your 'naughty' level, and so there is not enough space left to fit it in?

Have you tried multi-loading just the naughty level? And checking for crashed or 'extra' memory consumption.
Code:
while(1)
{
   level_load("naughty.wmb");
   diag_memory_usage();
   wait(-10);
}

That may expose an in-engine memory 'leak'...


Posted By: Tobias

Re: E1005 - Help - 10/16/10 09:43

That's a good idea. You dont even need diag_memory_usage, you can just observe the sys_memory in the F11 panel and see if your level leaves some memory unfreed.

Also check out the acklog, it normally tells pretty good where the problem happens. If its an entity in your level, you can put a diag output at the start of the entity action, then you see at least which entities load fine and do not use up all that memory.
Posted By: William

Re: E1005 - Help - 10/18/10 12:00

Is the engine supposed to show around 1,777,000 K in the task manager dialog? This is what it is normally at when it crashes. It does not just issue this error on the loading of a certain level.

By loading the same level over and over it doesn not give an error or increase the sys_memory. Here is a way I can make the error appear, load the tutorial level, then load a racetrack, then load the tutorial level again. This will make the error.

However, if I load load let's say 8 different racetracks in different orders the error wont appear.

But, if I do the first it does. There is some times where it won't give the error on the first method but instead give a directX texture error saying it can't create a "Skin2". And the tutorial level will run a second time. But then if I load any other level in the game the E1005 appears.
Posted By: jcl

Re: E1005 - Help - 10/18/10 12:32

Your levels are 1.777 GB? I guess you then don't need to look for the problem much further. Consider to make that a little smaller. A max size of 400..500 MB would be ok.
Posted By: William

Re: E1005 - Help - 10/18/10 12:59

No of course not. The level with the problems .wrs is 22.7MB. An entire demo with 8 levels and everything else published is only around 700MB. I don't know why it shows this high. The sys_memory is only at 450MB. The nexus is at 150MB.

What does it mean for the memory in the task bar? How does this compare to sys_memory in the diag?
Posted By: jcl

Re: E1005 - Help - 10/18/10 13:08

sys_memory should be somewhat smaller than the memory in your task manager.

sys_memory is the sum of all memory allocations by the engine, and depends on what you have in your level and scripts. The task manager memory is the overall consumed memory by the process. It is calculated by Windows, while sys_memory is calculated by the engine. sys_memory is a var and thus can not (and should not!) exceed 1 GB.

If you have huge discrepancies between both, you're maybe doing things that consume memory but don't affect sys_memory - for instance, opening new tasks, loading DLLs or something like that. Make some tests, for instance load your levels without script or your script without level, and check where the discrepancies come from.
Posted By: William

Re: E1005 - Help - 10/18/10 13:21

Thanks for the run down, this type of information helps me find the problem. Do you think that this error could be caused by memory consumed that the engine does not allocate? For instance, would the engine detect in the sys_memory FMOD sounds like these which are loaded through a .dll:


ftorpedo_bounce = fsoundSampleLoad(FSOUND_FREE, "Audio\\torpedo_bounce2.ogg", FSOUND_NORMAL+FSOUND_FORCEMONO, nullvector);
fdynamad_explode = fsoundSampleLoad(FSOUND_FREE, "Audio\\dynamad_explode.ogg", FSOUND_NORMAL+FSOUND_FORCEMONO, nullvector);
fdynamad_travel = fsoundSampleLoad(FSOUND_FREE, "Audio\\dynamad_travel.ogg", FSOUND_NORMAL+FSOUND_FORCEMONO, nullvector);
fdynamad_shoot = fsoundSampleLoad(FSOUND_FREE, "Audio\\dynamad_shoot.ogg", FSOUND_NORMAL+FSOUND_FORCEMONO, nullvector);

Do you think that this problems lies on the FMOD.dll not removing it's memory properly? Other than that, I can't really see anywhere that my other .dll's would use much memory, as it's just ANET, mysql, and the xbox controller plugin.

Since my sys_memory only shows about 450MB that means that over 1GB is somehow allocated elsewhere... I just don't know how. All my songs are streamed too.
Posted By: jcl

Re: E1005 - Help - 10/18/10 13:35

Yes, that's possible. Memory allocated by external DLLs is not counted by sys_memory.
Posted By: William

Re: E1005 - Help - 10/18/10 13:38

Alright, heres something that is odd. I am entering the IGF demo and it's due today, so I published a new demo. Now when I run the published version, the engine shows about 450MB in the taskbar upon loading the menu without a level.

Once the level is loaded it shows around 750 on average, this is mostly the same regardless of the level.

Now I just loaded around 10 different levels including the problem one and couldn't get this error to happen at all.

But in the development version the error will show every time and the task bar memory is completely different(about 1GB more memory).

Any ideas why this is?
Posted By: alibaba

Re: E1005 - Help - 10/18/10 14:12

Just set warn_level=0; and you will get no error massage grin In pulished versions you won´t get any error messages, because i think warn_level wil automatically set to 0. Just heavy errors, like while loop without a wait or other heavy errors let the engine crash, but you won´t get a error message.
Posted By: jcl

Re: E1005 - Help - 10/19/10 09:23

This error message is not affected by the warn level. It is a hard error, meaning that the application must terminate.
Posted By: alibaba

Re: E1005 - Help - 10/19/10 11:06

OH!Then... just ignore my post laugh
Posted By: pegamode

Re: E1005 - Help - 10/20/10 08:05

Thanks to this thread I was able to figure out where the same problem in my project came from.

I only get this error when starting my project with SED in debug mode. In that case about 1GB additional memory is allocated by the process and once I reach a memory consumption of about 1.6GB I get either E1005 or DirectX "can't create texture - out of memory".
Posted By: William

Re: E1005 - Help - 10/20/10 11:27

Oh wow, perhaps that explains it, those are the exact errors I recieve. Although I use the black arrow to run my game from SED and not the red one.

I can't get the error to appear in the published version no matter what(loaded 20 levels). But I can get it to appear in the development one everytime after 3 level loads.


Posted By: pegamode

Re: E1005 - Help - 10/20/10 11:51

I just gave it a try ... I only get the error when using SED in debug mode (red arrow). When I use the test run button (the black one) the allocated memory is somewhat higher than in the published version, but far away from starting in debug mode.
Posted By: William

Re: E1005 - Help - 11/23/10 09:43

Will this problem be fixed? It only happens when running the engine through SED/WED and not the published version. The reason I need it fixed is that I have some levels that won't even load up once because the engine consumes so much memory(1.7GB+). This means I have to cut back on texture resolution and art assets that could otherwise be much much better.

Thanks.
Posted By: jcl

Re: E1005 - Help - 11/23/10 12:25

I thought pegamode already found the problem?
Posted By: pegamode

Re: E1005 - Help - 11/23/10 14:42

In my case I only get the error if I run my project in debug mode (I don't know why debug mode consumes about 1GB more memory, but I think there will be a simple reason).

William seems to get the same error although he is not running his project in debug mode, but by just starting it from SED / WED.
Posted By: jcl

Re: E1005 - Help - 11/23/10 15:46

There are two reasons for that. First, when the engine is started in debug mode, it allocates more memory for code and variables. When you have a huge script and use large arrays, this can use a lot of memory, up to 100 MB or more.

The second reason is that the engine runs as a SED process in debug mode, meaning that you have to terminate SED after a debug session. Otherwise the memory is not freed and accumulates with every debug run. Of course this does not happen when you only start your project, without debugging.

When you start it from WED with the map open at the same time, you need at least twice the memory. Once for the engine and once for the map in WED. For fixing this, just don't have several programs consuming huge memory amounts running at the same time. Better start the engine with SED, or even better, start it directly with a shortcut or from a command line.
Posted By: William

Re: E1005 - Help - 11/24/10 11:33

I'm just clicking the black run button in SED to play. I don't ever use the debug mode or anything, and just tried WED for testing. From what I gather, the black arrow button should not be causing this?
Posted By: jcl

Re: E1005 - Help - 11/24/10 15:40

Correct. The black run button just starts the engine with the name of your script and the command line options you've set up.

When your game consumes a different amount of memory dependent on in which folder you start it, the first thing I'd do is comparing the files in the publish and development folders.
Posted By: William

Re: E1005 - Help - 11/24/10 23:06

Do you mean my work folder? Should I take out anything not related to the game? Does it read subfolders as well?
Posted By: jcl

Re: E1005 - Help - 11/25/10 13:35

As far as I've understood you, your problem was that when you start your game from the work folder, it consumes more memory than when you start it from the CD folder? So check any file differences in the work folder and path, compared to the CD folder. I mean files with the same name, but different content or different size.
Posted By: William

Re: E1005 - Help - 11/25/10 22:48

Yeah, I found some image files and deleted them. The memory is still huge but at least I can run and test now. I am running the game from the work folder for testing only.
Posted By: William

Re: E1005 - Help - 04/06/11 10:05

Well this problem reared it's ugly head again... after switching to windows 7 32 bit I cannot get the game to even run through "test mode" in SED. It just loads the game up and takes about 1.6GB in the memory counter of the taskbar. It then crashes instantly with directx errors. Windows 7 uses more memory natively than XP did.

So... I tried re-installing A8 with the latest edition, created an empty work folder, and the copied and pasted the files from my demo folder. In total the whole Gstudio folder is 900 MB.

But that did not matter, the problem is still there! It consumes 1.6GB for a 900MB folder.

The problem does not appear if I publish the game. The game in the published folder uses the exact same resources I put in the work folder and only takes 400MB to load up.

Any ideas on this problem? It looks like it's gotta be an engine issue only relating to the non-published engine.
Posted By: jcl

Re: E1005 - Help - 04/06/11 14:42

No. The development engine uses indeed more memory for internal diagnostics, but the difference is in the ~1 MB range.

From what you posted so far, the problem was never solved. Do not ignore such a problem during development. You should always have an idea which memory your game resources require. When it's suddenly 1 GB more than you expect, you better care about that before doing anything else.

Check the memory indicators in the status panel - they tell you when something uses an unusual amount of memory. This should help you to find the problem. F.i. when it's the nexus, the reason is an object in the level; otherwise it could be a media file or something you allocate in the script.
Posted By: William

Re: E1005 - Help - 04/07/11 09:51

Yeah your right, I'm sorry I never pursued it properly until it became a bigger problem. frown

But I would like to find it now. I also remember that it happened in A7 too, it's just I didn't really come to notice it as back then I thought my game just consumed to much memory. But then I published the game and realized that was not the case. And of course as time went on the game grew, and this problem became more of an issue but I could still test. Now that I am moving to windows7 it is a huge issue as I cant develop properly.

Test #1:

Here is a process I tried on my 32bit Windows XP machine with 3GB of installed ram. The numbers with stars by them is what the taskbar shows.

First when I hit the black run arrow in SED during compilation the memory goes to 1.1GB* and then hits 1.5GB*
when game starts(and loads main menu):

nx-21854
m - 462835
geo - 0
shd - 192
ent - 3969
v - 699392

uu1 - 0
uu2 - 0

count of
ent 10
vis 9
par 0
lit 0
snd 0
fnc 11
bdy 0
con 0

I load up the first level and memory goes to 1.6GB*

I Load a second level, and it goes up to 1.5GB* and then quickly it go down to 799MB* after the level is loaded.

nx - 149676
m 462675
geo - 0
shd - 0
ent - 103410
v - 532480

ent 293
vis 156
tri 36k
par 8
lit 0
snd 0
fnc 227
bdy 0
con 0

I then go back to main menu and memory stays at about 900MB*.

I then load the first level again and the memory goes up to 985MB*.

I then load 4 more levels before hitting out of memory error or a directx error. The taskbar shows about 1GB* at this time.

Test#2:

Windows XP 32bit.

I do the same procedure as above, except this time, I load up different levels. The memory in taskbar shows 1.4GB-1.6GB throughout 5 different level loads before crash. All stats are the same as above.

Test #3:

This one I tried on my 64bit Windows 7 machine with 12GB of ram.

The stats all read the same except the v in the memory column equals -88000. Which is odd because the graphics card has 1GB.

I load up the first level and the game crashes because of directx memory errors(cannot create bmap, ect.).

For some odd reason, windows7 based machines with way more ram crash instantly once the game hits about 1.6GB in the taskbar. Whereas on windows Xp you can sit around 1.6GB for about 5-6 level loads before it finally crashes.

Test#4

I compile the game down and run it with same code and assets. Main menu memory shows at 400MB* in taskbar. Once I load a level it goes up to 700MB* and I can load 30 levels in a row fine...

Maybe some file reacts differently in the development versus the published version and chews memory. It's worth noting that in all the development tests, before any major level loads(menu level is empty for most part), the memory has already hit 1.5GB*. Whereas it is 400MB in published version.

This makes me assume it's either engine related or something in the script that only triggers in the dev version.

Silas has huge scripts, with 100'000's of lines of code. Many variables, ect. But I am willing to look hard if you have an idea on some leads. I have different plugins like fmod, ect. too.

I really appreciate your help with this JCL.
Posted By: William

Re: E1005 - Help - 04/07/11 13:26

Okay I've spent the last couple hours bringing my project down peice by peice.

What I noticed is there are no irregular memory scripts or items. Basically I deleted all my scripts from the bottom up.

If it were a file on my end, the memory would have gone down drastically at one point. But it did not, and instead, just steadily went down as I kept removing everything right until the end.

So I decided to make you a test level with about 20,000 lines of random vars and a few strings.

With nothing in a level the taskbar memory reads 30MB with the development version.

With all these variables it reads 100MB with the development version.

------------------

Now. When I publish this exact same script down to a .exe it only reads 35MB when running! Which is about a 60% difference in size between development and published. This is the exact same ratio my entire game is showing as well!

This script only contains vars, nothing else.

I've emailed it to you.
Posted By: jcl

Re: E1005 - Help - 04/07/11 14:37

Thanks for the test project. I've looked into it. There is no noticeable memory difference between the published and unpublished versions. But when you compile it, it does indeed use almost 40 MB more. The reason for this appears clear when looking in the code.

You have about 29000 variables defined in your script. The compiler stores all variable names in an XML list and in a hash file, which occupy about 20 MB for a script of this size. Additionally, the compiler assumes from your script size that the resulting code will be extremely large, and reserves another 16 MB for it. In fact your code is quite short, but the script size sums up to a huge memory requirement for compiling that code.

When you don't change the script often, use the automatic compiling option for saving that 40 MB. But this does not explain your problem with 600 MB extra memory, at least if you're not really using incredibly large scripts.
Posted By: William

Re: E1005 - Help - 04/08/11 03:57

I've sent you another email. With a test showing functions take 7.5 times more memory in the dev version, and strings take 4.5 times the memory in dev version.
© 2024 lite-C Forums