Git Product home page Git Product logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
Whoops.  I was just looking around your issues and noticed issue 32.  I promise 
I searched beforehand!

I actually didn't know about the boolean on prepare that allows me to specify 
that I don't want the statement cached.  That's useful.

Anyway, I'd still maintain that the cache is an unexpected feature, and at 
least needs a limit.

Original comment by [email protected] on 26 Aug 2011 at 4:27

  • Added labels: ****
  • Removed labels: ****

from sqlite4java.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
Brian, thanks for posting this issue.

I see nothing terrible in OutOfMemoryError and 100MB of used memory - it 
allowed you to discover caching in sqlite4java and the additional option to 
prepare method. :) Anyone can easily write code, using any library or not, that 
would consume all of the memory and terminate. 

I think we could have a bounded LRU cache for the statements, but I doubt its 
usefulness. Imagine it were there, and your application wouldn't terminate 
because out of memory - but because you didn't know about the caching, it would 
still consume, say, 50MB constantly. Not a good thing. Unbounded cache is more 
fail-fast.

What makes sense to me is that probably most users don't need this caching. 
There is benefit in caching the results of prepare(), but it is likely to be 
negligible in the context of most apps. The library was created with really 
strong performance requirements in mind -- the SQLParts class, for example, is 
intended to avoid concatenating Strings when creating generated SQL, to produce 
less garbage.

I think we can add a SQLite.setCacheStatementByDefault() method to govern the 
call to prepare() without explicit cache parameter, and have the corresponding 
flag set to false initially. This would not be backwards-compatible with the 
current version though - current users would have to call 
SQLite.setCacheStatementByDefault(true) to revert to the old version behavior.

Thoughts?

Cheers
Igor

Original comment by [email protected] on 26 Aug 2011 at 11:02

  • Added labels: ****
  • Removed labels: ****

from sqlite4java.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
At the moment, we have decided not to go ahead with any caching improvements, 
given the existing method parameter. Should there be sufficient demand for this 
feature, the issue may be reopened.

Thanks,
Igor

Original comment by [email protected] on 21 Sep 2014 at 6:27

  • Changed state: WontFix
  • Added labels: ****
  • Removed labels: ****

from sqlite4java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.