memory-management

How much memory can x64 process can take on 4GB RAM

泄露秘密 提交于 2019-12-25 05:07:07
问题 I have a x64 application. It is a bit heavy application (in terms of thread counts, memory needed etc). I'm running this application on a 4GB RAM 64-bit Windows7 Quad core machine. But what i notice is after my application takes around 2.2-2.3 GB Ram it crashes. Is this required behavious? Can 64bit applications at max take only 2.3-2.4 GB RAM from 4GB RAM? 回答1: No, check that you don't have any overflows or other bugs first. Even 32-bit applications can address - use more RAM, so it would be

new in using XCode Instruments to interpret memory warning for iPhone development, guidance needed

亡梦爱人 提交于 2019-12-25 05:01:30
问题 I am working on an iPhone game which receives memory warning that I am not experienced enough to interpret. I have been watching some iTunesU tutorial but I am still not very good at this.. I have received various memory leaks whilst running my game and I wanted to understand how to interpret the stack trace show in Instruments properly. I attach a screenshot of the ObjectAllocation instrument output . Even when I zoom filter I don't manage to filter the data in the ObjectSummary . The peaks

Can't locate abandoned memory in iOS App

ぐ巨炮叔叔 提交于 2019-12-25 05:00:30
问题 I'm developing a game for iOS and the game is being terminated after some game screens. I launched instrument in Xcode and I realized the memory keeps growing between my screens. ARC is enabled. I used the mark generation featured to try to track the abandoned memory between the first two screens as you can see in the image below. Generations A is taken in TitleScreen right after firing the app. B, C, and D are from the TitleScreen right after coming back from ChoosePlayer. These screen have

Can a local variable's memory be accessed outside its scope?

心已入冬 提交于 2019-12-25 04:56:09
问题 I have the following code. #include <iostream> int * foo() { int a = 5; return &a; } int main() { int* p = foo(); std::cout << *p; *p = 8; std::cout << *p; } And the code is just running with no runtime exceptions! The output was 58 How can it be? Isn't the memory of a local variable inaccessible outside its function? 回答1: How can it be? Isn't the memory of a local variable inaccessible outside its function? You rent a hotel room. You put a book in the top drawer of the bedside table and go

Importance of Virtual Memory when memory is very cheap

我只是一个虾纸丫 提交于 2019-12-25 04:34:20
问题 This question was asked to one of seniors in a programming interview. According to me, because the sizes of memory accessed by softwares are increasing, the memory may soon be exhausted. So in this case if we used swapping, it would be inefficient. So we would go for virtual memory because it maps the memory in the disk to the main memory. But if we can have very huge memory then would virtual memory be of use? And please tell if the above answer needs some modifications. 回答1: Virtual memory

A shot in the dark - Application bug

回眸只為那壹抹淺笑 提交于 2019-12-25 04:33:42
问题 Ok so this is gonna be a bit of a shot in the dark without you being able to see my application! I have a bug. I have a SwimmingPool class, my app passes the pool from a tableview into a detail view where you can see all the swimmingPool class fields. You can then click on the individual detail, edit it, and then save it. The 'original' pool facility is copied and passed to the view controller responsible for actually making changes. If the user presses save, the fields are copied from the

python recursion over 10000 nodes

蓝咒 提交于 2019-12-25 04:30:27
问题 I have a list of over 10000 items and using recursion i want to iterate over all the possible combinations of their selection starting from 1st item for both its selection and not selection ( 2 branches ) then deciding on 2nd item for each branch and so on till last item in DFS way. I am using this code for optimization and most of the branches are not iterated over but atleast 1 leaf will be reached as to find the best the problem is I made a recursion code in python and it works fine for

iOS Memory management issue with ARC

*爱你&永不变心* 提交于 2019-12-25 03:53:20
问题 I've created a class called " ConnectionManager " that will handle all network request and fetch data from the server and after that call to a completion handler. ConnectionManager.h #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "UIAlertView+CustomAlertView.h" #import <Crashlytics/Crashlytics.h> @interface ConnectionManager : NSObject<NSURLSessionDataDelegate> @property (weak, nonatomic) NSMutableData *receivedData; @property (weak, nonatomic) NSURL *url; @property (weak,

Question about reference count of this code

不打扰是莪最后的温柔 提交于 2019-12-25 03:47:14
问题 In the code below, arguments has a reference count of 3 (shown by NSLog)...i would like to understand why...I am trying to manage the memory here and am running into some fundamental misunderstandings...it seems like every time the object is reference in the code the reference count goes up, however, in this case, arguments is only referenced once (other than the allocation), and would therefore lead me to believe that the reference count should only be 2. At any rate...can someone please

Green Hills Integrity Dynamic memory allocation

蓝咒 提交于 2019-12-25 03:19:10
问题 I have a requirement which need to repeatedly allocate and deallocate memory. Currently trying it on Integrity ARM simulator. I have created two tasks : First task(encoder): receives video data from a socket and encodes it and send it to second task. Second task(decoder): receives data from encoder and decodes it. In this decoding process it dynamically allocates memory and after decoding deallocates memory. After some time decoder task is suspended and cannot read protected memory error