recycle

RecyclerView does not Recycling Views when use it inside NestedScrollView

主宰稳场 提交于 2020-01-09 12:42:07
问题 I'm using RecyclerView inside NestedScrollView . Also i set setNestedScrollingEnabled to false for recyclerview to support lower API ViewCompat.setNestedScrollingEnabled(mRecyclerView, false); Now! When user scrolled the view every thing seems okay, but!!! views in recyclerview does not recycled!!! and Heap size grows swiftly!! Update : RecyclerView layout manager is StaggeredLayoutManager fragment_profile.xml : <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas

Do we have to explicitly recycle the bitmap if we don't need it?

半世苍凉 提交于 2020-01-04 08:16:11
问题 Bitmap has a recycle method, but do we have to invoke it explicitly if we don't need it any more? For example, an ImageView has a bitmap now. When user click a button, it will set a new bitmap to the ImageView. Do we have to recycle the original bitmap before assign the new one? 回答1: yes you have if you are targeting devices with Android older the 3.0 . That's will avoid you to incour in the OutOfMemoryException . Note: Before android 3 the Bitmap memory is allocated in the native heap. The

data.table efficient recycling

泄露秘密 提交于 2020-01-02 12:39:50
问题 I frequently use recycling in data.table, for exemple when I need to make projections future years. I repeat my original data fro each future year. This can lead to something like that : library(data.table) dt <- data.table(cbind(1:500000, 500000:1)) dt2 <- dt[, c(.SD, .(year = 1:10)), by = 1:nrow(dt) ] But I often have to deal with millions of lines, and far more columns than in this toy exemple. The time increases .. Try this : library(data.table) dt <- data.table(cbind(1:50000000, 50000000

Why isn't IIS cleaning up the old worker processes (w3wp.exe) on pool recycle leading to website out of memory exception?

岁酱吖の 提交于 2020-01-01 03:52:10
问题 I have an asp.net-mvc site and recently I am getting an out of memory exceptions on my web server. I only have 1 application pool and we recent set IIS to recycle after it hits a certain limit. I went in the other day and saw 4 w3wp.exe processes running (each with ~1.8GB memory being used) I assume that during the recycle process, it's not killing the old worker process and eventually I get out of memory exceptions on my website because the box only has 8GB memory. I can add memory to the

Memory usage does not decrease even I recycle bitmaps

可紊 提交于 2020-01-01 03:37:08
问题 I have A and B activities. When I start activity B from activity A, I set static bitmap variable on activity B. I show that bitmap on the screen and rotate it. When activity B is finished, I recycle all bitmaps on onDestroy() method but memory usage is not decreasing. @Override protected void onDestroy() { super.onDestroy(); if (bitmap90 != null) { bitmap90.recycle(); bitmap90 = null; } if (bitmap180 != null) { bitmap180.recycle(); bitmap180 = null; } if (bitmap270 != null) { bitmap270

Understanding the ViewHolder pattern

╄→尐↘猪︶ㄣ 提交于 2019-12-25 10:01:15
问题 I created an adapter for a ListView which has two types of rows. The ListView has 4 rows. The last row has a different layout, that's why i use the GetItemViewType method in getview I'm trying to understand how the pattern works. I watched this: https://www.youtube.com/watch?v=bWsWe9T9HJw to get a better understanding of how recycling works What i don't understand is: when i scroll down in my listview, the convertview is always null. When i scroll back up again, the convertview is not null

Android: Handle ListView Recycle

不问归期 提交于 2019-12-24 03:17:02
问题 I am developing a soundboard application in which I use Listview Activity. But since Listview of Android has the property of recycling its listviews, the changes I make to the selected textview gets reflected in all the pages while scrolling the listview. I don't want this to happen. So how do I handle it properly. If somebody can help me out with code snippet, it will be really helpful and I appreciate your effort. Thank you! Edit: Hope this will explain better My class extends ListActivity

Does changing any sub-directory or file in an ASP.NET application recycles the app pool

亡梦爱人 提交于 2019-12-23 03:45:46
问题 I thought I knew ASP.NET well, until a couple of hours ago. I am aware an IIS can recycle an app domain due to a variety of reasons including changes to web.config/bin/App_GlobalResources etc. file/directories, or otherwise on schedule or on specific events (like reaching a specific memory threshhold). I was very sure my code was NOT hitting any of these conditions. Basically a regular http request would trigger a small task in a background thread (ThreadPool.QueueUserWorkItem) that woould

ListView Virtualization value repeating in Recycling Mode

允我心安 提交于 2019-12-22 08:34:14
问题 I have a strange problem with virtualization enabled ListView control. I created a very small pilot app to reproduce the issue. When I type-in something for a few textboxes in the listview and then scrolling down, after a few pages the typed-in values are repeating in the untouched textboxes below. Here is the XAML of the window: <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Should I set ASP.NET application pool to auto-recycle?

核能气质少年 提交于 2019-12-22 02:04:15
问题 I have a number of ASP.NET (4.0) web applications that appear to leak (a small amount) of memory during each request. It is such a small amount, that for most use-cases, it will not grow to become a problem for weeks or even months at a time. I generally try to be good with closing any connections managed by the application, avoiding state-variables (or instance variables for my singleton), etc. My question is this - is this normal behavior for ASP.NET applications? I had turned off the