huge vector

Discussion in 'C++' started by Simon Adler, Oct 6, 2004.

  1. Simon Adler

    Simon Adler Guest

    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
     
    Simon Adler, Oct 6, 2004
    #1
    1. Advertisements

  2. Simon Adler

    Attila Feher Guest

    In short: Please post code!

    Medium: Talk is cheap, show me the code!

    Politically Correct: Please post the smallest compilable code experiencing
    the error.
    I did not know they can cook.
     
    Attila Feher, Oct 6, 2004
    #2
    1. Advertisements

  3. 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.
     
    Peter van Merkerk, Oct 6, 2004
    #3
  4. I think you have a bug in your program.

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

    Right, you have a bug somewhere, probably nothing to do with the size of the
    vector.
    Guessing isn't good enough. But this doesn't sound like a memory leak, it
    sounds like a plain old bug.
    Post some code, if it's not too much.

    john
     
    John Harrison, Oct 6, 2004
    #4
  5. I've got some Problems with a Programm.
    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
     
    Niels Dybdahl, Oct 6, 2004
    #5
  6. Simon Adler

    JKop Guest

    Simon Adler posted:


    Line 15, you misspelled "vector".


    -JKop
     
    JKop, Oct 6, 2004
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.