garbage-collection

Renderscript ScriptIntrinsicYuvToRGB and Bitmap allocation

旧巷老猫 提交于 2019-12-25 03:34:25
问题 I want to make my own SurfaceView and send there a frames which I've obtained from onPreviewFrame(byte[] data, Camera camera) method. To do it, I need to conver frames from Yuv to ARGB and to draw them to a Canvas to my SurfaceView. Here is my onPreviewFrame: public void onPreviewFrame(byte[] data, Camera camera) { if (camera != null) { camera.addCallbackBuffer(data); } // using RenderScript Bitmap bitmap = RenderScriptFilter.convertYuvToRgbIntrinsic(rs, data, PREVIEW_WIDTH, PREVIEW_HEIGHT);

Android bitmaps reuse

a 夏天 提交于 2019-12-25 02:42:52
问题 I am a newbie in Android ! I have some huge problems with Android's SDK, as I'm developing an app that uses huge bitmaps (> 1200 * 1000) and the problem is during the app I need multiple layers/bitmaps of the same size (3-5 of them). The problem is memory heap is consumed very quickly on one of these allocations and OutOfMemory exception is triggered. The good part is that I don't need all of the bitmaps in the same time. I tried the recycle() method calling, although I understood it's

Parallel.ForEach - System Out of Memory Exception

ぐ巨炮叔叔 提交于 2019-12-25 02:17:15
问题 I have a problem with my website crawler as I get System Out of Memory Exception after it crawls something around 700 URLs. Memory usage is raising from the start and in one moment program just stops. It is a console application written in C#. I think the problem is that i instantiate 6 new objects at every foreach loop. Than i pass through them, get property values with reflection and create the final object that i use to DB save. I expect .NET to destroy those object when not using them

Rendering using Weak References, and the GC

北城余情 提交于 2019-12-25 00:36:41
问题 The Problem I've recently started learning C# . I am doing this through making a game (as I am quite familiar with this in C++ ). Objects that are to be drawn to the back buffer are 'registered' upon construction via an event being sent with a weak reference to the object. With C++ smart pointers being reference counted and (as a result) objects being destroyed as soon as the last reference goes out of scope, this works well for my purposes. However, in C# , this is certainly not the case.

will clearing dictionaries do the garbage collector a favor?

我与影子孤独终老i 提交于 2019-12-25 00:13:21
问题 When I'm working with a set of non-struct object-object dictionaries ( Dictionary<ClassA,ClassB> ) will I do the GC a favor when I call Clear() on all of them? Or more interresting: Could it do any harm to the GC when I do this? All objects including the dictionaries are expected to be in generation 2 since it's a long running transformation which will also generate a large amount of short and medium lived helper objects. Update for the comments: The objects itself are mainly loaded by an

Memory leak - why too many “Ichangetoken” objects

好久不见. 提交于 2019-12-24 22:23:53
问题 Above is the screenshot when compared to baseline of memory dump. I have an api method, which I'm calling every 3 seconds and nothing else is going on in the environment like, no user using the environment. When I debug in VS2017, for each request that I make, I it is calling some services like "addtransient","addscopped" etc. and in the startup file we are configuring different config files return builder.AddDataEngineFile(s => { s.FileProvider = provider; s.Path = path; s.Optional =

Find pointers from pointee

杀马特。学长 韩版系。学妹 提交于 2019-12-24 21:03:42
问题 From this code: int x = 5; int other = 10; vector<int*> v_ptr; v_ptr.push_back(&x); v_ptr.push_back(&other); v_ptr.push_back(&x); Is there anyway I can know who points at x , from the x variable itself, so that I don't have to search inside v_ptr for address of x ? Is this possible in C++ or C++0x? I read that when doing garbage collection, they look at memory and see if anything points at it or not, then make decisions to delete the unused variable, etc. 回答1: No. It is like asking a person

Java: Serialization doesn't work for the second time

与世无争的帅哥 提交于 2019-12-24 16:12:34
问题 I have a server on which I keep track of some data. When I connect to the server with the administrator application to check out the current state of the data. I use a refresh rate of 5 seconds. The first time the server sends the data, it works. But the second time, when the data changed, the admin-side does not receive the up-to-date data. I'm sending the data, wrapped in a class, through an ObjectOutputStream and ObjectInputStream: This is the wrapper class for the data: public class

Nested Functions, how are they garbage collected in flash actionscript 3?

旧城冷巷雨未停 提交于 2019-12-24 15:48:50
问题 I have a very complex function in as3. The function is composed of many other functions which are nested inside of it. The main function has variables and all it's nested functions also have their own variables. Some of the nested functions are called by events that were added in the main function or in another nested function. Now I want to know, when will my main function be garbage collected? When will the code be out of the main function? And when will the variables and the events and the

How to force/reproduce FullGC in JVM?

限于喜欢 提交于 2019-12-24 15:09:56
问题 Is there a way to force/reproduce FullGC in JVM for x seconds ? Basically I needed this to verify root cause of an issue in certain heart beat based app ( a client of zookeeper) EDIT : Does unix command kill -STOP <pid> and kill -CONT <pid> simulate FullGC ( stop the world behaviour) ? 回答1: You can simulate a very long stop-the-world event on HotSpot JVMs which is similar to FullGC from user's point of view. HotSpot doesn't put safepoints into counted int loops, because it assumes that they