detecting the memory page size
Is there a portable way to detect (programmatically) the memory page size using C or C++ code ? ...
Is there a portable way to detect (programmatically) the memory page size using C or C++ code ? ...
Hi guys, I have the following code for creating an NSString to contain the body of the text file and then convert it to NSData and output it to a file. NSString *particleString = [[NSString alloc] initWithFormat:@"%@", @"This is the body of my file"]; NSData *metaVals = [particleString dataUsingEncoding:NSISOLatin1Stri...
In java i have two variables String string; int integerValue; I want to convert these values to unsignedbyte that is How to convert string to UnsignedByte and integer to UnsignedByte ...
Does calling unset() free the memory that was associated with that object? There are a couple cases where I find myself handling large associative arrays and I would like to remove them when done (freeing up memory to create new ones). ...
I'm trying to build something (ultimately a gem but for now an application) that works as follows. Suppose for example the DB records are breeds of dog. There's a Dog parent class and a child class for each breed. The actual breeds aren't known until runtime. When the server begins it will load up records from the DB and instantiate ...
Hi, After running our stress testing on our ASP.NET application access to internal web services, our mid-tier server (where we host ASMX .NET 3.5 web services) showed close to 1GB of memory consumption. Upon the review of memory dump from mid-tier server, I have found over 1000 objects of Microsoft.Xml.Serialization.GeneratedAssembly.A...
In the spirit of question http://stackoverflow.com/questions/3356005/java-why-does-maxpermsize-exist, I'd like to ask why the Sun JVM uses a fixed upper limit for the size of its memory allocation pool. The default is 1/4 of your physical RAM (with upper & lower limit); as a consequence, if you have a memory-hungry application you have ...
Hello All, i am working on an application where i need to find RIP value several times during execution of my application on 64 bit linux. this is relevant to stack walk algorithm on Linux 64 bit. i can use asm instructions and ptrace for the same, but now i want to use some other algorithm for the same. for this understanding of the r...
How does the memory usage of php/apache and asp.net/iis compare as the number of simultaneous users connecting increase when running a real world app and how is the memory allocated due to the different process models ? Examples would be great. Figures for our current asp.net app show that the asp.net worker process on my dev box is usi...
Hello, I'm writing an application (basically its yet another iBooks clone) which consumes a lot of memory. Depending on the input data, it's memory footprint can go up to 70-80 MB (as MemoryMonitor states) or even more. It works fine for quite some time, but it tends to increase its memory footprint over time. So lets say you open a boo...
Possible Duplicate: Setting variable to NULL after free I am learning about good C programming practices and my friend told me to always set the pointers to NULL after free()ing them (or calling a specific freeing function). For example: char* ptr = malloc(100); ... free(ptr); ptr = NULL; or struct graph* graph = create_...
I have below code which is causing memory leak -(NSString *) getSingRecord: (NSString *) getStatement{ NSString *sql=getStatement; sqlite3_stmt *statement; NSString *fieldFlagI=@"0"; if (sqlite3_prepare_v2(db, [sql UTF8String], -1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { char *fie...
Hi all! I'm fighting a memory leak in a Python project and spent much time on it already. I have deduced the problem to a small example. Now seems like I know the solution, but I can't understand why. import random def main(): d = {} used_keys = [] n = 0 while True: # choose a key unique enough among used previ...
I did some reading on cache misses optimization and come to know this stdlib function. It does some kind of memory alignment for optimization, but can any1 help me explain what this function really does? It takes 3 arguments: void* * memptr, size_t alignment, size_t size The part that I don't get is what the documentation means by ...
Hi, Is it possible to allocate a 1D memory space int *x=(int *)malloc(100*sizeof(int)); and then recast the returned pointer to 2D array e.g. int **y=(int **)x; and access it as if it was 2D array e.g. y[1][2] = 12;? My aim is to take a shared memory segment and return 1D,2D,...ND array depending how the user wants to interpret this...
As suggested here I fixed my 2D array of numbers to make it work with Vector class. Header file: #include <vector> typedef std::vector<int> Array; typedef std::vector<Array> TwoDArray; And here is how it's used: TwoDArray Arr2D; // Add rows for (int i = 0; i < numRows; ++i) { Arr2D.push_back(Array()); } // Fill in test data ...
I'm having frequent crashes on iOS 4.0 within my application due to excessive memory. Instruments tells me that it's category is "Malloc 600KB" and the responsible library is ImageIO and the responsible caller is ImageIO_Malloc. I'm using lots of images in this app but no more than I have used in other applications. It's odd because if I...
In some systems, the stack grows in upward direction whereas the heap grows in downward direction and in some systems, the stack grows in downward direction and the heap grows in upward direction. But, Which is the best design ? Are there any programming advantages for any of those two specific designs ? Which is most commonly used and w...
I have written a small WinForm application in C#. The EXE that is made is 74 Kb and all together with the resources and all it sizes 179 Kb. But when I run it, it takes 9.1 MBs in memory according to Task Manager. So my question is: Why is it happening? What can I do to reduce the size of this? If the size could be reduced how much r...
In my application I use lots of images based in interface builder. The problem with this is that it uses large amounts of memory because interface builder caches it much liked "imageNamed" so I've begun removing the image from imageViews in interface builder and instead adding them once the view starts using "imageWithContentsOfFile". Af...