Comments (3)
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.
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.
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)
- Support for OS X 10.9 HOT 3
- Eclipse plugin compatible HOT 1
- SQLiteQueue responds to InterruptedException HOT 2
- On OS X, native libraries are not loaded even when they are in the same directory as .JAR file, but it's not the current directory HOT 2
- Enter one-line summary HOT 1
- Support for library unloading HOT 6
- Disk I/O error - error 3850 HOT 1
- update sqlite HOT 1
- Log possible library names when loading native library HOT 2
- Store library version in resource and use it as library version suffix HOT 2
- Deleting a database HOT 4
- Unable to reuse SQLiteStatement after error HOT 2
- Raspberry Pi HOT 8
- Cached long arrays are never destroyed HOT 1
- Support methods with long sizes
- Arm64 bit HOT 6
- Information about users HOT 1
- SnapDragon Lib HOT 2
- Multithreading options? HOT 4
- Migrate project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlite4java.