soft-references Questions
5
Solved
I'm on my way with implementing a caching mechanism for my Android application.
I use SoftReference, like many examples I've found. The problem is, when I scroll up or down in my ListView, the mo...
Amon asked 22/4, 2011 at 17:8
7
Solved
I know there is a WeakHashMap in java.util, but since it uses WeakReferences for everything, which is only referenced by this Map, referenced objects will get lost on the next GC cycle. So it's nea...
Moskow asked 5/11, 2008 at 8:3
12
Solved
What's the difference between java.lang.ref.WeakReference and java.lang.ref.SoftReference ?
Quotient asked 18/11, 2008 at 18:26
7
I have read this article about different types of references in Java (strong, soft, weak, phantom), but I don't really understand it.
What is the difference between these reference types, and when ...
Steady asked 21/3, 2012 at 16:43
4
Solved
Do SoftReference and WeakReference really only help when created as instance variables? Is there any benefit to using them in method scope?
The other big part is ReferenceQueue. Besides being able...
Dissension asked 22/1, 2013 at 2:17
4
Can someone explain the difference between the three Reference classes (or post a link to a nice explanation)? SoftReference > WeakReference > PhantomReference, but when would I use each one? Why i...
Izolaiztaccihuatl asked 25/7, 2010 at 15:8
1
As per the link https://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html, PhantomReferences are enqueued only when the object is physically removed from memory and WeakReference...
Tithe asked 6/10, 2014 at 7:31
1
Solved
I was wondering whether there is a way to refer data from many different arrays to one array, but without copying it.
Example:
import numpy as np
a = np.array([2,3,4,5,6])
b = np.array([5,6,7,8])...
Ilan asked 21/4, 2015 at 13:41
1
Solved
The JDK 7 documentation has this to say about a SoftReference:
"All soft references to softly-reachable objects are guaranteed to have been cleared before the virtual machine throws an OutOfMemo...
Cleaves asked 3/1, 2014 at 10:16
3
Solved
It seams that Dalvik's garbage collector doesn't respect SoftReferences and removes them as soon as possible, just like WeakReferences. I'm not 100% sure yet, but despite the fact that there is sti...
Shields asked 25/10, 2010 at 11:19
3
Solved
The basic difference is that weak references are supposed to be claimed on each run of the GC (keep memory footprint low) while soft references ought to be kept in memory until the GC actually requ...
Gilford asked 13/10, 2011 at 14:46
9
I really love WeakReference's. But I wish there was a way to tell the CLR how much (say, on a scale of 1 to 5) how weak you consider the reference to be. That would be brilliant.
Java has SoftRefe...
Putout asked 27/11, 2008 at 20:52
4
Solved
I'm aware of this question for java, but none of those implementations seem to play well with scala.collection.JavaConversions.
I'm looking for something simple (e.g. single file, not a whole lib...
Beneficial asked 25/2, 2011 at 0:22
4
Solved
I read many articles, but I don't understand - where do I need to use Weak and Phantom references in practice? Soft references - is a good choice for cache, as I understand. But weak and phantom, I...
Reconvert asked 9/7, 2012 at 14:49
5
Solved
I am familiar with WeakReference, but I am looking for a reference type that is cleared only when memory is low, not simply every time when the gc runs (just like Java's SoftReference). I'm looking...
Deliberation asked 10/3, 2009 at 20:4
4
Solved
What is a use case for a soft reference in Java? Would it be useful to garbage collect non-critical items when a JVM has run out of memory in order to free up enough resources to perhaps dump criti...
Maegan asked 10/3, 2010 at 23:46
5
Solved
I have two separate caches running in a JVM (one controlled by a third party library) each using soft references. I would prefer for the JVM to clear out my controlled cache before the one controll...
Mobster asked 29/3, 2012 at 19:47
12
Solved
I need to cache objects in Java using a proportion of whatever RAM is available. I'm aware that others have asked this question, but none of the responses meet my requirements.
My requirements are...
Aixlachapelle asked 28/1, 2010 at 23:45
2
Solved
To get any code with SoftReference<T> to be fully tested, one must come up with some way to test the 'yup, it's been nulled' case. One might more or less mock this by using a 'for-test' code ...
Albuquerque asked 11/5, 2010 at 20:1
5
In C++ I'm using boost::shared_ptr and boost::weak_ptr to automatically delete objects that are no longer needed. I know these work with reference counting.
In Java, memory is managed by a garbage...
Bladder asked 4/7, 2010 at 14:45
2
Solved
In other languages (e.g. Java), object references can be Strong, Weak, Soft or Phantom (http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html).
In Python, references are Stro...
Circumsolar asked 7/9, 2011 at 9:13
1
Solved
Here's my use case. We are trying to narrow down a potential memory leak in an application, and we are using a memory analysis tool to snapshot the heap so we can look for object instances and refe...
Aldric asked 6/8, 2011 at 16:25
2
Solved
Per the documentation for Guava's MapMaker.softValues():
Warning: in most circumstances it is better to set a per-cache maximum size instead of using soft references. You should only use this me...
Wanderlust asked 6/7, 2011 at 6:2
5
I'm going to use a SoftReference-based cache (a pretty simple thing by itself). However, I've came across a problem when writing a test for it.
The objective of the test is to check if the cache d...
Absence asked 24/9, 2010 at 9:22
1
Solved
I have a series of views in a vertical LinearLayout. Each view generates and draws a Bitmap, when scrolled to. For performance reasons, I would rather not generate the Bitmap each time onDraw() is ...
Melo asked 3/12, 2010 at 16:8
1 Next >
© 2022 - 2024 — McMap. All rights reserved.