xTruncate is not being called because this is an in-memory database.  Memory 
databases should have memory freed instead I assume?

Thanks,
Dave

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 16, 2007 3:07 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] DROP INDEX not freeing up memory

Dave Gierok <[EMAIL PROTECTED]> wrote:
>
> I am running an in-memory db and am using the functionality where
> we override all the OS calls such that we implement our own memory
> management and file IO.  Therefore, I am able to easily track the
> amount of memory Sqlite is taking up.  I have noticed that when I
> call CREATE INDEX and then the corresponding DROP INDEX, I do not
> see the memory drop to the same level as it was before the CREATE
> INDEX.  I also call VACUUM after DROP INDEX, which makes no difference.
>

I tried this using the built-in database functionality and the
memory is being freed there.  I did:

   CREATE TABLE t1(x);
   INSERT INTO t1 VALUES('hello');
   CREATE INDEX i1 ON t1(x);
   DROP INDEX i1;
   VACUUM;

And then set a breakpoint at pager.c:1972 where the freeing of
memory occurs, and it does happen.

But I have no way to trouble-shoot your overridden OS calls.
The first place I would look would be in your implementation
of sqlite3OsTruncate().  Are you sure you are doing it right?
Does sqlite3OsTruncate() get called when you VACUUM?

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to