Results 1 to 2 of 2

Thread: Data handling

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2008
    Posts
    13

    Data handling

    Hey guys,

    I need a little advice from you. Right now, my graphic engine projects loads a model from hdd (let's say, a cube) and copies this cube for every object in the graphic memory (so, if i load 300 objects, i have the same model 300 times in my memory), which is, politly said, a waste of memory.

    I'm planning to load every model only once into the memory, the same with textures and so on. Now I started a discussion with a friend, if it is better to hold every model/texture once in the memory or to unload it when it's unused for a certain time.

    What do you think which way is better? I think it's better to hold the data, so I don't have to reload it, when it was unused for a while.

    I hope you can help me (as well as I hope, that I'm in the right subforum)

    Have a nice day,
    Shelling

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Data handling

    Unless you have to handle a big number of different heavy models, you can stick with loading it once in memory for ever.

    Then, a more appropriate approach can be some sort of cache :
    - keep a list of active objects : A
    - a list of loaded objects : B (all A is included in B)
    This B list contain for each model, its size in memory and the last time it was used.
    When total of (memory taken by B - memory taken by A) is too big (you can have a configurable threshold, or use other metrics such as total memory taken by your app, etc), deallocate the least recently used models.
    - then when the A list need a model which is not in B, load it from disk.

Similar Threads

  1. AMD glUseProgramStages 0 handling
    By DeanoC in forum OpenGL: Drivers
    Replies: 1
    Last Post: 11-06-2011, 10:04 PM
  2. Handling big images
    By swald in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 01-09-2006, 12:25 PM
  3. Exception handling?
    By heck in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 03-06-2001, 12:08 AM
  4. Handling Image
    By Björne in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-23-2001, 02:48 AM
  5. [OMX-IL] Buffer handling
    By pedwo in forum OpenMAX
    Replies: 2
    Last Post: 12-31-1969, 07:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean