memory-management

Set pointers on Dynamic Matrix

怎甘沉沦 提交于 2020-01-07 02:59:06
问题 I'm trying to make a dynamic size matrix of 1-byte elements. To do so I defined the following function. The problem comes when I try to set the first "nrows" elements of the matrix to point the corresponding row (so I can do matrix[i][j]). It looks like that matrix[i] = matrix[nrows + i * single_row_elements_bytes]; doesn't work well enough (the program compiles but throws an core-segment-violation error). How can I make this work? uint8_t **NewMatrix(unsigned nrows, unsigned ncols) { uint8_t

Ignite doesn't free memory after cache destroy

我们两清 提交于 2020-01-06 23:51:36
问题 I'm using Ignite engine as a bean inside a Spring boot web application. The cache configuration is as follows: <bean id="ignite" class="org.apache.ignite.IgniteSpringBean"> <property name="configuration"> <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="cacheConfiguration"> <list> <bean class="org.apache.ignite.configuration.CacheConfiguration"> <property name="atomicityMode" value="TRANSACTIONAL" /> <property name="cacheMode" value=

URLClassLoader Memory Leak Java

守給你的承諾、 提交于 2020-01-06 21:01:09
问题 I have been going through a lot of URLClassLoader Memory leak solutions on the internet, but I haven't found any fully working code and precise solution. The closest to a solution I found was this Any fully functional code or link to it, which uses WeakHashMap() or any other definite way of eliminating memory leak problem on multiple redeploys? 回答1: just add the dependency of class loader leak preventer in your build path. maven dependency for this is : <!-- For Classloader leak protection --

iOS: Debugging memory leaks for UILabel in swift

放肆的年华 提交于 2020-01-06 20:23:47
问题 I new to profiling and using instruments in xcode. I am facing of problem of memory leaks in tableViewCell for UILabel(CALayer). In my code all the tableViewCell have a fixed view called bottomView. This bottomView may or may not contain UILabel which can be either directly within bottomView or within a subView of bottomView. Every time within the init method for cell I check for bottomView and remove it from superView and set it to nil. Then reinitialise the bottomView (using UIView(frame: )

Failed to allocate timer 0: no slots left and unable to set dynamic row height

风流意气都作罢 提交于 2020-01-06 19:59:39
问题 I have a screen which call a listfield . public class Main_AllLatestNews extends MainScreen { private Database_Webservice webservice; private String[] title, category, date, imagepath = {"no picture", "no picture", "no picture", "no picture","no picture","no picture","no picture","no picture","no picture", "no picture"}; private int[] newsid; private List_News newslist; public Main_AllLatestNews(final boolean needdownload) { super(USE_ALL_WIDTH); webservice = new Database_Webservice(); add

deleting object pointer referring by two pointers

纵饮孤独 提交于 2020-01-06 19:55:10
问题 I have an object say. ClassA *obj1 = new ClassA; ClassA *ptr1 = obj1; ClassA *ptr2 = obj1; When I do delete ptr1; , will it affect ptr2 ? If so what can be the correct solution for this? 回答1: (assuming obj2 is supposed to be obj1 ) ClassA *x defines a pointer that can point to objects of type ClassA . A pointer isn't an object itself. new ClassA allocates (and constructs) an actual object of type ClassA . So the line Class A *obj1 = new ClassA; defines a pointer obj1 and then sets it to point

How to use PHP to parse large XML file sequentially

蹲街弑〆低调 提交于 2020-01-06 18:33:26
问题 I'm trying to parse a moderately large XML file (6mb) in php using simpleXML. The script takes each record from the XML file, checks to see if it's already been imported, and, if it hasn't, updates/inserts that record into my own db. The problem is I'm constantly getting a Fatal error about exceeding memory allocation: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 256 bytes) in /.../system/database/drivers/mysql/mysql_result.php on line 162 I avoided that

Memory is not getting released

拟墨画扇 提交于 2020-01-06 18:03:56
问题 When I run the following program ... application is holding some 5MB of memory even after releasing all objects ... when I don't add an object to list everything works fine ... but I am not sure why application is holding memory even after releasing the list. I have read this link "NSMutableArray big memory hog?" and even tried with custom mutable array by mikeash MACollections -- in all the cases ... the memory allocated in the loop never get released if I add the object into list. Please

Getting Full sized image from camera, Memory Issue

落花浮王杯 提交于 2020-01-06 15:18:07
问题 I am using this line of code for getting the full sized image, i am not setting this image on any view, still this line when executed takes a lot of ram, around 110-120m, any solutions ? I even tried running this code in Backgroung thread using Async Task. The picture resolution is 4008*5344. Bitmap image = MediaStore.Images.Media.getBitmap(getContentResolver(),Uri.parse(mCurrentPhotoPath)); And the below method given in developers site, gives me Null bitmap. private void setPic() { // Get

How i solve memory leak problem?

ぐ巨炮叔叔 提交于 2020-01-06 12:49:15
问题 I developing an simple application in which design or make code in which i creating and instance object of UIImage. When i swip on Ipad screen it make up an image of the sreen and that image i render into UIImage object after that this image i set into UIImageView object and UIimage object is released. Every time i swipe on the screen and above process is does again and again. But it give me leak in renderImage = [[UIImage alloc] init]; . Code, _renderImage = [[UIImage alloc] init];