Re: Advice needed for memory intensive app
From: Gerry Quinn (gerryq_at_indigo.ie)
Date: 11/24/03
- Next message: Gerry Quinn: "Re: Writing an Emulator"
- Previous message: Derk Gwen: "Re: Do I need a web server on my computer to view my PHP scripting locally?"
- In reply to: Ian Woods: "Re: Advice needed for memory intensive app"
- Next in thread: Sheldon Simms: "Re: Advice needed for memory intensive app"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 24 Nov 2003 16:23:42 GMT
In article <Xns943CE2FBDC8B0newspubwuggyorg@217.32.252.50>, Ian Woods <newspub2@wuggyNOCAPS.org> wrote:
>"BCC" <a@b.c> wrote in
>> I have an application in c++ which is basically a glorified cellular
>> automaton. The ca is a 3D array of objects, and we are trying to
>> figure out a way to lighten things up because we are running out of
>> memory.
>>
>> I pulled out everything that I could that did not actually store a
>> value and placed it in a 'helper' class for both CCellBase and CValue,
>> but this doesn't seem to be enough.
>>
>> For example, if we want a 100x100x100 matrix, this is 1,000,000 Units.
>> If we want to have everything initialized at some point, all the
>> classes combined will sum up to several million objects.
>>
>> I have studied the flyweight design pattern and concluded that it does
>> not apply to this model- my units only contain non-duplicate
>> information at this point.
>>
>
>The lower bound (without using things like compression) is simply
>answerable:
>
>a) take the number of things you need to store
>b) find out how big each of them is...
>c) add them all together
>
>No matter what you do you'll have to store that much data /somewhere/. If
>that has to be main memory, and main memory isn't big enough, you're
>stuck. Well, not quite stuck - you now have to deal with off-line data.
Like he says.
When you say the data is non-duplicated, do you mean that it is
*different* for each cell? If the cells are mostly empty, you could
just store the filled ones.
Other than that, the obvious things to do are:
1. Buy more memory
2. Design it so that you can page efficiently to and from disk. For a
3D cellular automaton, chopping it into cuboids might be a good idea.
Gerry Quinn
-- http://bindweed.com Screensavers and Games for Windows Download free trial versions New arcade-puzzler just out - "Volcano"
- Next message: Gerry Quinn: "Re: Writing an Emulator"
- Previous message: Derk Gwen: "Re: Do I need a web server on my computer to view my PHP scripting locally?"
- In reply to: Ian Woods: "Re: Advice needed for memory intensive app"
- Next in thread: Sheldon Simms: "Re: Advice needed for memory intensive app"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|