memory issue

i’m displaying a large data set of triangles, using :
glBegin(GL_LINES);
for(long i…)
{
glvertex3f(x,y,z)
glvertex3f(x,y,z)
}
glEnd();

it works but takes much memory… This memory belongs to the X process, not to my application process… ( i mean very much, like hundreds of megs causing disk swap)

Any idea about why is this and how could i get through ?

You could try submitting smaller batches (like, glEnd and glBegin again every thousand triangles or so).

You could try using a vertex array (or several smaller arrays).

Is there something more to know?
for example, given n vertices, how much memory goes away? How much vertices are you really sending?

i’m sending something like 160.000 vertices. ( with glVertex3d )
It takes about 200 Mo in memory :frowning:

And this memory isn’t release when i exit properly from my application…

Your driver apparently has a big memory leak !

What is your card/drivers/distro ?

Originally posted by adrien:
[b]i’m sending something like 160.000 vertices. ( with glVertex3d )
It takes about 200 Mo in memory :frowning:

And this memory isn’t release when i exit properly from my application…[/b]
Are you sure this is due to X and not to your program ? After all, it seems really strange X provokes such a leak.

You should really give more information if you want someone to help you well.

I installed th driver of the video card ( nvidia geforce4 mx 440) and it solved the problem.

For those who are interested, i give some details :
i was using the mesa3d driver, the glxinfo command gave me :
name of display: :0.0
display: :0 screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
client glx vendor string: SGI
client glx version string: 1.2
client glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.3 Mesa 4.0.4
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3,
GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_lod_bias
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat

0x23 24 tc 1 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 0 0 None
0x24 24 tc 1 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 0 0 None
0x25 24 tc 1 24 0 r y . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x26 24 tc 1 24 0 r . . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x27 24 dc 1 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 0 0 None
0x28 24 dc 1 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 0 0 None
0x29 24 dc 1 24 0 r y . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x2a 24 dc 1 24 0 r . . 8 8 8 8 0 16 8 16 16 16 16 0 0 None

and the glxinfo -l gave me :
name of display: :0.0
display: :0 screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
client glx vendor string: SGI
client glx version string: 1.2
client glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.3 Mesa 4.0.4
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3,
GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_lod_bias
OpenGL limits:
GL_MAX_ATTRIB_STACK_DEPTH = 16
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 16
GL_MAX_CLIP_PLANES = 6
GL_MAX_COLOR_MATRIX_STACK_DEPTH = 4
GL_MAX_ELEMENTS_VERTICES = 2147483647
GL_MAX_ELEMENTS_INDICES = 2147483647
GL_MAX_EVAL_ORDER = 30
GL_MAX_LIGHTS = 8
GL_MAX_LIST_NESTING = 64
GL_MAX_MODELVIEW_STACK_DEPTH = 32
GL_MAX_NAME_STACK_DEPTH = 64
GL_MAX_PIXEL_MAP_TABLE = 256
GL_MAX_PROJECTION_STACK_DEPTH = 32
GL_MAX_TEXTURE_STACK_DEPTH = 10
GL_MAX_TEXTURE_SIZE = 2048
GL_MAX_3D_TEXTURE_SIZE = 2048
GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 2048
GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 2048
GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 2048
GL_MAX_TEXTURE_UNITS_ARB = 6
GL_MAX_TEXTURE_LOD_BIAS_EXT = 6
GL_MAX_VIEWPORT_DIMS = 2048, 2048
GL_ALIASED_LINE_WIDTH_RANGE = 1, 10
GL_SMOOTH_LINE_WIDTH_RANGE = 1, 10
GL_ALIASED_POINT_SIZE_RANGE = 1, 10
GL_SMOOTH_POINT_SIZE_RANGE = 1, 10
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat

0x23 24 tc 1 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 0 0 None
0x24 24 tc 1 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 0 0 None
0x25 24 tc 1 24 0 r y . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x26 24 tc 1 24 0 r . . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x27 24 dc 1 24 0 r y . 8 8 8 0 0 16 0 0 0 0 0 0 0 None
0x28 24 dc 1 24 0 r y . 8 8 8 0 0 16 8 16 16 16 0 0 0 None
0x29 24 dc 1 24 0 r y . 8 8 8 8 0 16 8 16 16 16 16 0 0 None
0x2a 24 dc 1 24 0 r . . 8 8 8 8 0 16 8 16 16 16 16 0 0 None

With the driver from Nvidia, i obtain glxinfo with direct rendering to yes and many options.
But an interesting point is in glxinfo -l that gives :
OpenGL limits:
GL_MAX_ATTRIB_STACK_DEPTH = 16
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 16
GL_MAX_CLIP_PLANES = 6
GL_MAX_COLOR_MATRIX_STACK_DEPTH = 2
GL_MAX_ELEMENTS_VERTICES = 4096
GL_MAX_ELEMENTS_INDICES = 4096
GL_MAX_EVAL_ORDER = 8
GL_MAX_LIGHTS = 8
GL_MAX_LIST_NESTING = 64
GL_MAX_MODELVIEW_STACK_DEPTH = 32
GL_MAX_NAME_STACK_DEPTH = 128
GL_MAX_PIXEL_MAP_TABLE = 65536
GL_MAX_PROJECTION_STACK_DEPTH = 4
GL_MAX_TEXTURE_STACK_DEPTH = 10
GL_MAX_TEXTURE_SIZE = 2048
GL_MAX_3D_TEXTURE_SIZE = 64
GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 512
GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 2046
GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 3
GL_MAX_TEXTURE_UNITS_ARB = 2
GL_MAX_TEXTURE_LOD_BIAS_EXT = 15
GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 2
GL_MAX_VIEWPORT_DIMS = 4096, 4096
GL_ALIASED_LINE_WIDTH_RANGE = 1, 10
GL_SMOOTH_LINE_WIDTH_RANGE = 1, 10
GL_ALIASED_POINT_SIZE_RANGE = 1, 63
GL_SMOOTH_POINT_SIZE_RANGE = 1, 63

Things are in same order than with the mesa3d driver except for the field : GL_MAX_ELEMENTS_VERTICES that is 2048 for nvidia driver and 2147483647 for the mesa3D…

this is quite strange…

By the way, i tried to call glEnd();glBegin(); every thousand of glVertex3d with the mesa3d driver but it doesn’t change anything…

Are you using a display-list? There are some problems in older versions of Mesa with the display list implementation. There’s no memory leak per se, but they end up using WAY more memory than they should.

i’m not using display lists. i use basic calls to glvertex3d

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.