memory usage

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

memory usage

Post by Hoopy »

I'm not sure if it's 1.70 or some of the new OXPs, but I played for an hour or so, left the PC for and hour and came back to see that oolite was using just under 2Gig of private bytes (this is on a PC, using process explorer to see the actual memory usage). Methinks we have a memory leak somewhere...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

We know that there are some, the question is where. What screen was it on when you left it? (There’s a known leak which primarily affects the galactic chart screen and is fixed for 1.71.)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6628
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Yes we do, indeed. There has been a new one discovered recently, on the demo ships screen at the beginning of the game. Just leaving the ships parade for something like two complete cycles will use about 400MB more memory than normal.

Also, v1.70 has a huge memory leak on the short range chart screen. Leaving this screen on for a long time can actually end up in the application terminating, after consuming every last bit of system memory.

Thankfully, this short range chart screen one has already been plugged. We are still investigating the other one.
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

it may well have been on the f6 screen. i thought that was fixed in 1.70 though. so that explains it.

edit: ooh! I'm ELITE now :) still only 36th in the posting list though...
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Maybe it is related with loading textures into memory. The more heavy textured oxps you have the more frequent the incident is. Now that I have 2 GB of memory things are somehow better but I am afraid that it is a more complicated issue.
For the last 3 weeks I am playing oolite with shift –f option and task bar permanently open. The last time I had a violent exit due to memory leak it was after a hyperspace jump and I saw that 1 second after the hyperspace jump the indication was objs:485 collisions:4023.

I do not know if all the above are helpful but I hope so.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Ark wrote:
Maybe it is related with loading textures into memory. The more heavy textured oxps you have the more frequent the incident is. Now that I have 2 GB of memory things are somehow better but I am afraid that it is a more complicated issue.
Textures do use a lot of memory (and legitimately so). A 1024x1024 colour texture uses four megabytes of memory. Depending on the OpenGL implementation and which optimizations are in effect, there may be as many as three copies of this data in main memory (one belonging to Oolite and two in different formats belonging to OpenGL/the driver), as well as one on the graphics card or in AGP memory. In a busy system there may well be 50 or more textures in use at once. On a graphics card with “only” 64 or 128 MB of memory – not all of it available for textures – texture paging (moving textures in and out of VRAM) may occur quite often, even if you rarely need 50 textures for a given frame. So, yeah, Oolite does require a lot of memory for textures when you have many OXPs. Especially Griff’s ones. ;-)

Even so, the test releases of Oolite (at least back to 1.69, I don’t remember exactly) do free up memory for textures that are no longer in use, except planet textures. Oolite 1.65 and earlier keep all textures loaded after the first time they’re used.

There are probably a number of leaks of less heavyweight objects. The one on the galactic chart screen was leaking quite small objects, but a rate of several thousand per frame. Ouch.
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

running process explorer whilst playing is quite interesting, looks like it leaks 20Mb everytime you select a save file (ie you use 60Mb moving to the thirs one down)
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

I'm running 1.70 and have had a few instances of locking up at the end of the hyperspace countdown, it's not much of a problem it's happened a few times. Here's the error report:

2008-03-13 14:50:37.218 oolite.exe[16284] File NSUserDefaults.m: 562. In [NSUserDefaults +standardUserDefaults] Improper installation: No language locale found
2008-03-13 14:50:37.218 oolite.exe[16284] [unclassified.MyOpenGLView]: initialising SDL
2008-03-13 14:50:37.578 oolite.exe[16284] [unclassified.JoystickHandler]: init: numSticks=0
2008-03-13 14:50:37.578 oolite.exe[16284] [unclassified.MyOpenGLView]: CREATING MODE LIST
2008-03-13 14:50:37.578 oolite.exe[16284] [unclassified.MyOpenGLView]: Unknown architecture, defaulting to 1024x768
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 1440 x 900
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 1360 x 768
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 1280 x 1024
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 1152 x 864
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 1024 x 768
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 800 x 600
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 720 x 576
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 640 x 480
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 512 x 384
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 400 x 300
2008-03-13 14:50:37.593 oolite.exe[16284] [unclassified.MyOpenGLView]: Added res 320 x 240
2008-03-13 14:50:37.734 oolite.exe[16284] [unclassified.MyOpenGLView]: drawRect calling initialiseGLWithSize
2008-03-13 14:50:37.734 oolite.exe[16284] [unclassified.MyOpenGLView]: Creating a new surface of 1440 x 868
2008-03-13 14:50:37.812 oolite.exe[16284] [unclassified.MyOpenGLView]: no universe, clearning surface
2008-03-13 14:50:37.828 oolite.exe[16284] [cpuInfo.cpuCount]: 2 processors detected.
2008-03-13 14:50:37.828 oolite.exe[16284] [rendering.opengl.version]: OpenGL renderer version: 2.0.6011 ("2.0.6011 WinXP Release")
Vendor: ATI Technologies Inc.
Renderer: Radeon X1300 Series x86/SSE2
2008-03-13 14:50:37.828 oolite.exe[16284] [rendering.opengl.extensions]: OpenGL extensions (97):
GL_ARB_multitexture GL_EXT_texture_env_add GL_EXT_compiled_vertex_array GL_S3_s3tc GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_multisample GL_ARB_occlusion_query GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_ARB_draw_buffers GL_ATI_draw_buffers GL_ATI_element_array GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_map_object_buffer GL_ATI_separate_stencil GL_ATI_shader_texture_lod GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_ATI_vertex_array_object GL_ATI_vertex_attrib_array_object GL_ATI_vertex_streams GL_ATIX_texture_env_combine3 GL_ATIX_texture_env_route GL_ATIX_vertex_shader_output_point_size GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_object GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_vertex_array GL_EXT_vertex_shader GL_HP_occlusion_test GL_NV_blend_square GL_NV_occlusion_query GL_NV_texgen_reflection GL_SGI_color_matrix GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_extensions_string WGL_EXT_swap_control
2008-03-13 14:50:38.015 oolite.exe[16284] [dataCache.found]: Found data cache.
2008-03-13 14:50:38.437 oolite.exe[16284] [searchPaths.dumpAll]: ---> OXP search paths:
(oolite.app/Resources, AddOns, AddOns/2mapgriff_krait.oxp, "AddOns/aegidian-special.oxp", "AddOns/aegidian-special.oxp/Assassins.oxp", AddOns/Anarchies1.0.oxp, AddOns/aphidv2.oxp, AddOns/asps.oxp, AddOns/Assassins.oxp, AddOns/att1.oxp, AddOns/bandersnatch.oxp, AddOns/Behemoth.oxp, AddOns/Cargo_wrecks_teaser.oxp, AddOns/Clearskies.oxp, AddOns/Commies.oxp, AddOns/custsounds.oxp, AddOns/dwcobra3.oxp, AddOns/GrittyCoriolis.oxp, AddOns/gwxstations.oxp, AddOns/hOopyCasino.oxp, AddOns/impcourier.oxp, AddOns/lasercoolant.oxp, AddOns/marett_vol1_b.oxp, AddOns/outrider.oxp, AddOns/RoC.oxp, AddOns/Sungs_detailed_textures.oxp, AddOns/supercobra.oxp, AddOns/taranis.oxp, AddOns/tgy_dev.oxp, AddOns/tianve.oxp, AddOns/YOUR_AD_HERE.oxp, AddOns/YOUR_AD_HERE_set_A.oxp, AddOns/YOUR_AD_HERE_set_B.oxp, AddOns/YOUR_AD_HERE_set_C.oxp, AddOns/YOUR_AD_HERE_set_D.oxp)
2008-03-13 14:50:38.453 oolite.exe[16284] [dataCache.upToDate]: Data cache is up to date.
2008-03-13 14:50:40.875 oolite.exe[16284] [script.load.world.listAll]: Loaded 16 world scripts: "assassins", "Behemoth-script01", "Cargo_test", "casinoship_appearance", "casinoship_revisit", "communist_population", "hoopy_casino", "oolite-cloaking-device" 1.70, "oolite-constrictor-hunt" 1.70, "oolite-nova" 1.70, "oolite-thargoid-plans" 1.70, "oolite-trumbles" 1.70, "Pi-Forty-Two Con stores", "Spawn-griff_krait_rich_pirate" 1.0.1, "supercobra_placement", "taranis_one"
2008-03-13 14:50:44.156 oolite.exe[16284] [dataCache.willWrite]: About to write data cache.
2008-03-13 14:50:44.375 oolite.exe[16284] [dataCache.write.success]: Wrote data cache.
2008-03-13 14:52:02.359 oolite.exe[16284] [script.javaScript.warning.206]: ----- JavaScript warning: The event handler willLaunch has been renamed to shipWillLaunchFromStation. The script Spawn-griff_krait_rich_pirate must be updated. The old form will not be supported in future versions of Oolite!
2008-03-13 14:52:02.359 oolite.exe[16284] [script.javaScript.warning.206]: (null), line 0.
2008-03-13 14:52:02.671 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 14:52:33.109 oolite.exe[16284] [script.debug.onOff]: SCRIPT debug messages ON
2008-03-13 14:52:33.109 oolite.exe[16284] [script.debug.onOff]: SCRIPT debug messages OFF
2008-03-13 14:58:03.156 oolite.exe[16284] [unclassified.MyOpenGLView]: Found mode {Height = 768; RefreshRate = 0; Width = 1024; }
2008-03-13 14:58:07.062 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 14:58:34.796 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xf860028 by 0xb1f5010
2008-03-13 14:58:34.796 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xf860028 by 0xb1f85b0
2008-03-13 14:58:34.796 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xf860028 by 0xb1fbb50
2008-03-13 14:58:34.796 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xf860028 by 0xb1ff0f0
2008-03-13 14:58:34.796 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xf860028 by 0xb202690
2008-03-13 14:58:34.796 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xf860028 by 0xb205c30
2008-03-13 15:23:57.187 oolite.exe[16284] [dataCache.willWrite]: About to write data cache.
2008-03-13 15:23:57.406 oolite.exe[16284] [dataCache.write.success]: Wrote data cache.
2008-03-13 15:25:04.203 oolite.exe[16284] [unclassified.MyOpenGLView]: Found mode {Height = 768; RefreshRate = 0; Width = 1024; }
2008-03-13 15:25:14.343 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 15:25:46.203 oolite.exe[16284] [script.debug.onOff]: SCRIPT debug messages ON
2008-03-13 15:25:46.203 oolite.exe[16284] [script.debug.onOff]: SCRIPT debug messages OFF
2008-03-13 15:30:32.734 oolite.exe[16284] [unclassified.MyOpenGLView]: Found mode {Height = 768; RefreshRate = 0; Width = 1024; }
2008-03-13 15:30:35.875 oolite.exe[16284] [unclassified.MyOpenGLView]: Found mode {Height = 768; RefreshRate = 0; Width = 1024; }
2008-03-13 15:30:39.781 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 15:37:41.265 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 15:39:41.046 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 15:40:07.703 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xcee0028 by 0x24d7ee70
2008-03-13 15:40:07.718 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xcee0028 by 0x24d82410
2008-03-13 15:40:07.718 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xcee0028 by 0x24d86660
2008-03-13 15:40:07.718 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xcee0028 by 0x24d89c00
2008-03-13 15:40:07.718 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xcee0028 by 0x24d92010
2008-03-13 15:40:07.718 oolite.exe[16284] [entity.bug]: -[Entity subEntityReallyDied:] called for non-ship entity 0xcee0028 by 0x24d96010
2008-03-13 15:40:10.015 oolite.exe[16284] [script.debug.onOff]: SCRIPT debug messages ON
2008-03-13 15:40:10.015 oolite.exe[16284] [script.debug.onOff]: SCRIPT debug messages OFF
2008-03-13 15:41:31.640 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
2008-03-13 15:43:46.468 oolite.exe[16284] [unclassified.MyOpenGLView]: Found mode {Height = 768; RefreshRate = 0; Width = 1024; }
2008-03-13 15:43:55.218 oolite.exe[16284] [testscript.spawn]: Generated 4 griff_krait_rich_pirate for testing purposes.
Virtual memory exhausted

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6628
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Regarding TGHC's report: Right now, we are testing the latest version of the development build, where a fix has been checked in to address this very issue. If this works as expected, then we will have resolved probably the current most serious stability issue of the Windows version.
ovvldc
---- E L I T E ----
---- E L I T E ----
Posts: 344
Joined: Sat Apr 02, 2005 9:32 am
Location: Netherlands

Post by ovvldc »

Ahruman wrote:
Textures do use a lot of memory (and legitimately so). A 1024x1024 colour texture uses four megabytes of memory. Depending on the OpenGL implementation and which optimizations are in effect, there may be as many as three copies of this data in main memory (one belonging to Oolite and two in different formats belonging to OpenGL/the driver), as well as one on the graphics card or in AGP memory.
I noticed the Wiki suggests using textures of 512x512 (which uses just over a quarter of the memory). But I get the feeling that the increasing amount of eye candy in OXPs can still overwhelm low end systems, especially because it is so easy to just add another OXP to your add-ons folder for fun.

I have a final-model iBook with 32 MB of VRAM myself....

Best wishes,
Oscar
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

I think there are ways to minimize the problems in V1.70.

1. Reduce most ingame used textures to 8Bit. I've done this and the memory leaking rate was nearly zero!!! Even after 20 minutes with a lot of ships (>100) in the system the leaking was <10MB and the used memory was correctly deallocated.

2. Disable the Station-Flashers (comment them out). This will reduce the system hangs nearby the station a lot.

3. If possible use 256x256px 8Bit-Maps for your own models. If there are not so much details you won't notice so much differences.

Hope this helps
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Svengali wrote:
1. Reduce most ingame used textures to 8Bit. I've done this and the memory leaking rate was nearly zero!!! Even after 20 minutes with a lot of ships (>100) in the system the leaking was <10MB and the used memory was correctly deallocated.
If you mean paletted (i.e., anything other than grayscale), this will have no effect at all.
Post Reply