Comments (11)
We've considered something like this for our project:
http://blog.wu-man.com/2012/10/twolevellrucache-standing-on-shoulder.html
I wouldn't mind having a memory cache sit ahead of the disk cache in a lot of cases. Of course optimally it would only drop to disk when the memory cache fills up.
from robospice.
David Stemmer has been working on an LruCache in memory that is supported by a file based ObjectPersister. It is integrated to master github's branch for now. We are waiting for a sample from David to integrate this new tech and realeasing RoboSpice cache 1.4.1.
from robospice.
Is there a pull request/discussion about this somewhere?
His approach is very simple and clean, and one I've seen used many places.
save:
put to memory cache
put in disk cache
However, I'd like an option to do this instead:
put in memory cache
if memory cache full (on entryRemoved(evicted=false)) drop to disk cache. It might be a good idea to try to group up the cache cleanups as well, to reduce disk io as much as possible and extend battery life. I don't know if it's a better idea, and it's more complicated, but I think it's worth considering.
from robospice.
The problem I got with this approach is that you can never know on Android
when your process is gonna get killed by memory pressure.
In that case, we have no hook to get notified and put the data to disk
before the RAM cache get garbage collected.
S.
2013/2/17 andaag [email protected]
Is there a pull request/discussion about this somewhere?
His approach is very simple and clean, and one I've seen used many places.
save:
put to memory cache
put in disk cacheHowever, I'd like an option to do this instead:
put in memory cacheif memory cache full (on entryRemoved(evicted=false)) drop to disk cache.
It might be a good idea to try to group up the cache cleanups as well, to
reduce disk io as much as possible and extend battery life. I don't know if
it's a better idea, and it's more complicated, but I think it's worth
considering.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-13682512.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
You can monitor onTrimMemory, I believe that's a pretty sure way of catching it. And you can do that in the service itself, so the activity knows as little about the caching/background stuff as possible.
from robospice.
Ok, I would be open to an implementation. Do you wanna fork RS ?
S.
2013/2/17 andaag [email protected]
You can monitor onTrimMemory, I believe that's a pretty sure way of
catching it. And you can do that in the service itself, so the activity
knows as little about the caching/background stuff as possible.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-13689628.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
Building something that sticks with memory cache by default and monitors onTrimMemory is on my todo list, but we're not quite there yet. When we get the application I'm working and move on to the polishing stage we'll do some performance measurements in the caching system and see if we want to replace it. If we get it working well you can expect a pull request :)
from robospice.
Fine ;)
2013/2/19 andaag [email protected]
Building something that sticks with memory cache by default and monitors
onTrimMemory is on my todo list, but we're not quite there yet. When we get
the application I'm working and move on to the polishing stage we'll do
some performance measurements in the caching system and see if we want to
replace it. If we get it working well you can expect a pull request :)—
Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-13761163.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
Issue is closed to clean up the list of issues. It can be reopened by anyone to submit a pull request.
from robospice.
Wouldn't it be better to assign a new label "needs contribution" or something like that instead of closing?
I don't think people will easily contribute to closed issues.
from robospice.
You are right, but is that possible with github ?
2013/5/16 StingerAJ [email protected]
Wouldn't it be better to assign a new label "needs contribution" or
something like that instead of closing?
I don't think people will easily contribute to closed issues.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-17988251
.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
Related Issues (20)
- proguard warning HOT 1
- Getting a Callback after Fragment has been detached
- Retrofit throwing exceptions for every single call HOT 2
- Caching skipped if List sub-type is involved HOT 2
- Is This library still maintained ? HOT 5
- robospice usecase: external rest-service returns null
- Could not find class 'com.octo.android.robospice.persistence.ObjectPersister' HOT 4
- Best Practice for design to connect to multiple services
- Robospice and binary post requests? HOT 5
- response headers missing? HOT 4
- removeDataFromCache(Class clazzm, Object cacheKey) not working on 1.4.13
- BigBinaryRequest with customized headers/interceptors.
- Android O background service limitations HOT 5
- Download a file with query params HOT 1
- java.lang.NoSuchMethodError: No virtual method No virtual method open(Ljava/net/URL;)Ljava/net/HttpURLConnection; HOT 10
- Build failed on windows (android studio2.23 @win7 64-bit), but no problem on Mac. HOT 4
- RoboSpice within the MVVM pattern HOT 2
- How to log api response time at common place? HOT 1
- Android O (8.1.0) : invalid channel for service notification HOT 8
- Xmlrpc Request
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 robospice.