I like that, it solves the problem of someone having to fix a problem that
might otherwise go un-noticed, probabally not good for a process that can't
automatically restarted, but I'm not building a mars rover! The memory leak
takes care of itself hopefully when the whole process dies (well get shut
down) :-)

Sandy


-----Original Message-----
From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 28, 2004 12:41 PM
To: [email protected]
Subject: [sqlite] Running out of memory


Roger Binns wrote:
 > [M]ost software does not play well with running out of memory...
 >

FWIW:  If a malloc() ever fails with SQLite, it will return
SQLITE_NOMEM.  It also sets a flag and will forever after
continue to return SQLITE_NOMEM even if you free up a bunch
of memory so that malloc() would start working again.  There
is no way to reset this condition.  Once a malloc() fails,
the party is over and you might as well shut down the process.

If malloc() fails, SQLite might also leak memory.  (Ironic,
isn't it?)

The only guarantees that SQLite makes after a malloc failure
is that it will not abort() or panic() or segfault.  Basically,
it just gives you a chance to shutdown gracefully.  This might
not sound like much, but as Roger points out, it is a lot
more than most other software packages offer.

--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565

Reply via email to