[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: memory debugging and C++ (program keeps crashing)



On Thu, Oct 03, 2002 at 09:36:00AM +1000, Brian May wrote:
> On Tue, Oct 01, 2002 at 08:49:47AM +0200, Cyrille Chepelov wrote:
> > > VG_(get_memory_from_mmap): request for 1953656832 bytes failed.
> > > VG_(get_memory_from_mmap): 58853360 bytes already allocated.
> > 
> > Something's trying to allocate 2 gigs of RAM (if I got the order of
> > magnitude right) I don't think that's something a regular process is 
> > supposed to succeed with frequently on x86-32.
> 
> Not my program... It works fine without valgrind (at least at the
> moment).

If I remember correctly, you can do

    ptr = malloc (<really large number>);

without problem.  The real memory allocation is delayed until the
memory is actually used.  So a program allocating but not using
2 gigs of memory would just run fine.

Jochen
-- 
                                         Omm
                                      (0)-(0)
http://www.mathematik.uni-kl.de/~wwwstoch/voss/privat.html

Attachment: pgpH4ZTIDt_fs.pgp
Description: PGP signature


Reply to: