huge vector

S

Simon Adler

Hello,

I've got some Problems with a Programm.
I use a Grid with Nodes. The Grid will be 64 * 64 Nodes huge.
Each Node is a float. Some Algorithms ha've to copy the whole
Grid, sometimes twice. If this happens, the code crashes. I've
to choose a smaller Grid Spacing from 32 * 32 Grid Nodes, or less.

Who can I use more Memory?
I use vector, just because I read that indexed access is fast.
An Ordinary float * is possible, but the Program crashes earlier.
I've no Memory Leaks, I guess!

Thanks for any Help!

Simon
 
A

Attila Feher

Simon said:
Hello,

I've got some Problems with a Programm.
I use a Grid with Nodes. The Grid will be 64 * 64 Nodes huge.
Each Node is a float. Some Algorithms ha've to copy the whole
Grid, sometimes twice. If this happens, the code crashes. I've
to choose a smaller Grid Spacing from 32 * 32 Grid Nodes, or less.

Who can I use more Memory?
I use vector, just because I read that indexed access is fast.
An Ordinary float * is possible, but the Program crashes earlier.
I've no Memory Leaks, I guess!

In short: Please post code!

Medium: Talk is cheap, show me the code!

Politically Correct: Please post the smallest compilable code experiencing
the error.
Sacred cows make great hamburgers.

I did not know they can cook.
 
P

Peter van Merkerk

Simon said:
Hello,

I've got some Problems with a Programm.
I use a Grid with Nodes. The Grid will be 64 * 64 Nodes huge.
Each Node is a float. Some Algorithms ha've to copy the whole
Grid, sometimes twice. If this happens, the code crashes. I've
to choose a smaller Grid Spacing from 32 * 32 Grid Nodes, or less.

Who can I use more Memory?
I use vector, just because I read that indexed access is fast.
An Ordinary float * is possible, but the Program crashes earlier.
I've no Memory Leaks, I guess!

Thanks for any Help!

How do you expect us to help you if you don't show any code that causes
the crash? Please post the smallest, complete and compilable program
that exhibits your problem.

See also:
http://www.slack.net/~shiva/welcome.txt


BTW: 64 * 64 floats doesn't occupy that much memory so probably the
problem has nothing to do with using too much memory.
 
J

John Harrison

Simon Adler said:
Hello,

I've got some Problems with a Programm.
I use a Grid with Nodes. The Grid will be 64 * 64 Nodes huge.
Each Node is a float. Some Algorithms ha've to copy the whole
Grid, sometimes twice. If this happens, the code crashes. I've
to choose a smaller Grid Spacing from 32 * 32 Grid Nodes, or less.

I think you have a bug in your program.
Who can I use more Memory?


64*64*sizeof(float) is not a lot of memory, I don't think that is your
problem.

I use vector, just because I read that indexed access is fast.
An Ordinary float * is possible, but the Program crashes earlier.

Right, you have a bug somewhere, probably nothing to do with the size of the
vector.
I've no Memory Leaks, I guess!

Guessing isn't good enough. But this doesn't sound like a memory leak, it
sounds like a plain old bug.
Thanks for any Help!

Post some code, if it's not too much.

john
 
N

Niels Dybdahl

I've got some Problems with a Programm.
I use a Grid with Nodes. The Grid will be 64 * 64 Nodes huge.
Each Node is a float. Some Algorithms ha've to copy the whole
Grid, sometimes twice. If this happens, the code crashes. I've
to choose a smaller Grid Spacing from 32 * 32 Grid Nodes, or less.

Who can I use more Memory?
I use vector, just because I read that indexed access is fast.
An Ordinary float * is possible, but the Program crashes earlier.
I've no Memory Leaks, I guess!

64x64xfloat is not very much (32 KB). So there is clearly a bug in your
code.
You have to post some code to get specific help.
Otherwise try to use a debugger and/or a boundschecker.

Niels Dybdahl
 
J

JKop

Simon Adler posted:
Hello,

I've got some Problems with a Programm.
I use a Grid with Nodes. The Grid will be 64 * 64 Nodes huge.
Each Node is a float. Some Algorithms ha've to copy the whole
Grid, sometimes twice. If this happens, the code crashes. I've
to choose a smaller Grid Spacing from 32 * 32 Grid Nodes, or less.

Who can I use more Memory?
I use vector, just because I read that indexed access is fast.
An Ordinary float * is possible, but the Program crashes earlier.
I've no Memory Leaks, I guess!

Thanks for any Help!

Simon



Line 15, you misspelled "vector".


-JKop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top