On Wed, Jan 18, 2012 at 4:30 PM, John Elrick <john.elr...@fenestra.com>wrote:

> I made one more stab and narrowed down the mallocs to this call:
>
> Count:    119,133 = 'sqlite3Parser_lt_YYNSTATEpYYNRULE(12)
> sqlite3Parser(11)
> sqlite3RunParser(10)
> sqlite3Prepare(9)
> sqlite3_prepare(8)
> sqlite3_exec_inner_loop_invoke_callback(7)
> sqlite3_exec_outer_while(6)
> sqlite3_exec(5)
> sqlite3Parser_lt_YYNSTATEpYYNRULE(4)
> sqlite3Parser(3)
> sqlite3RunParser(2)
> sqlite3Prepare(1)
> sqlite3_step(0)'
>
> /**CS_ID**/ fenestra_sqlite3_push(csid_sqlite3Parser_lt_YYNSTATEpYYNRULE);
>      yy_reduce(yypParser,yyact-YYNSTATE);
> /**CS_ID**/ fenestra_sqlite3_pop(csid_sqlite3Parser_lt_YYNSTATEpYYNRULE);
>
> I started looking at yy_reduce, but it looks machine generated.  If you
> give me some direction I'll see if I can narrow it down further.
>

Can you print out the SQL that is being parsed when this malloc is called?


>
>
>
> On Wed, Jan 18, 2012 at 4:02 PM, John Elrick <john.elr...@fenestra.com
> >wrote:
>
> > Whatever is happening, it appears I can only reproduce it under these
> > circumstances.  I'll continue digging into the procedure tomorrow to see
> if
> > I can narrow down where this is coming from.
> >
> >
> > On Wed, Jan 18, 2012 at 3:54 PM, John Elrick <john.elr...@fenestra.com
> >wrote:
> >
> >> FYI, I traced the number of calls to sqlite3ResetInternalSchema() on a
> >> smaller set of data.  It appears that it isn't the culprit.
> >>
> >> Total mallocs: 148,156
> >> Total calls to sqlite3ResetInternalSchema(): 63
> >>
> >>
> >>
> >> On Wed, Jan 18, 2012 at 3:41 PM, John Elrick <john.elr...@fenestra.com
> >wrote:
> >>
> >>> What else could trigger a call to sqlite3ResetInternalSchema()?  I'm
> >>> getting a clear breakpoint tracing back to such innocuous calls as
> >>> _sqlite3_step.
> >>>
> >>>
> >>>
> >>>
> >>> On Wed, Jan 18, 2012 at 3:31 PM, Richard Hipp <d...@sqlite.org> wrote:
> >>>
> >>>> On Wed, Jan 18, 2012 at 3:12 PM, John Elrick <
> john.elr...@fenestra.com
> >>>> >wrote:
> >>>>
> >>>> >
> >>>> > Total times _malloc called in test: 69,859,114
> >>>> >
> >>>> > Times calling _malloc: 57,679,282
> >>>> > sqlite3Parser(10)
> >>>> > sqlite3RunParser(9)
> >>>> > sqlite3Prepare(8)
> >>>> > sqlite3_prepare(7)
> >>>> > sqlite3_exec_inner_loop_invoke_callback(6)
> >>>> > sqlite3_exec_outer_while(5)
> >>>> > sqlite3_exec(4)
> >>>> > sqlite3Parser(3)
> >>>> > sqlite3RunParser(2)
> >>>> > sqlite3Prepare(1)
> >>>> > sqlite3_step(0
> >>>> >
> >>>>
> >>>> It looks like you might be doing something that is forcing SQLite to
> >>>> constantly reparse the schema.
> >>>>
> >>>>  *  CREATE or DROP statements
> >>>>  *  Registering new collating sequences
> >>>>  *  Registering new application-defined functions
> >>>>  *  ATTACH
> >>>>  *  VACUUM
> >>>>
> >>>> Maybe set a breakpoint on sqlite3ResetInternalSchema() to find out
> what
> >>>> is
> >>>> making the schema be reparsed so much.
> >>>>
> >>>>
> >>>> >
> >>>> > Times calling _malloc: 2,775,682
> >>>> > sqlite3RunParser(9)
> >>>> > sqlite3Prepare(8)
> >>>> > sqlite3_prepare(7)
> >>>> > sqlite3_exec_inner_loop_invoke_callback(6)
> >>>> > sqlite3_exec_outer_while(5)
> >>>> > sqlite3_exec(4)
> >>>> > sqlite3Parser(3)
> >>>> > sqlite3RunParser(2)
> >>>> > sqlite3Prepare(1)
> >>>> > sqlite3_step(0)
> >>>> >
> >>>> > Times calling _malloc: 2,775,682
> >>>> > sqlite3Prepare(8)
> >>>> > sqlite3_prepare(7)
> >>>> > sqlite3_exec_inner_loop_invoke_callback(6)
> >>>> > sqlite3_exec_outer_while(5)
> >>>> > sqlite3_exec(4)
> >>>> > sqlite3Parser(3)
> >>>> > sqlite3RunParser(2)
> >>>> > sqlite3Prepare(1)
> >>>> > sqlite3_step(0)
> >>>> >
> >>>> > Times calling _malloc: 2,092,350
> >>>> > sqlite3Parser(3)
> >>>> > sqlite3RunParser(2)
> >>>> > sqlite3Prepare(1)
> >>>> > sqlite3_step(0)
> >>>> > _______________________________________________
> >>>> > sqlite-users mailing list
> >>>> > sqlite-users@sqlite.org
> >>>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>>> >
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> D. Richard Hipp
> >>>> d...@sqlite.org
> >>>> _______________________________________________
> >>>> sqlite-users mailing list
> >>>> sqlite-users@sqlite.org
> >>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> John Elrick
> >>> Fenestra Technologies
> >>> 540-868-1377
> >>>
> >>>
> >>
> >>
> >> --
> >> John Elrick
> >> Fenestra Technologies
> >> 540-868-1377
> >>
> >>
> >
> >
> > --
> > John Elrick
> > Fenestra Technologies
> > 540-868-1377
> >
> >
>
>
> --
> John Elrick
> Fenestra Technologies
> 540-868-1377
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to