hi there,
why doesn't this work:
Snippet 1:
int *a = new int[6];
(*a)[0]=1;
while this is working
Snippet 2:
int myint = 0;
int *ptr =
*ptr=1;
I know that if i use a[0]=1 in snippet 1 it will work. But for me that makes no sense, cos for me it looks that a[0]=1 means: put value 1 to adress a[0]. In other words I put the value...
I've got an application that does few computational CPU work, but mostly memory accesses (allocating objects and moving them around, there's few numeric or arithmetic code).
How can I measure the share of the time that am I spending in memory access latencies (due to cache misses), with the CPU being idle?
I should note that the app is...
I'm trying to debug an issue using VC++ 6.0. I think the problem is something accessing a buffer after it was freed, and so I'm wondering if the VC++ debugger has a nifty feature to monitor a block of memory and break as soon as something tries to access it.
Any ideas appreciated, as are very simple instructions :-)
Thanks, Sam.
...
Im currently working with two actors in scala. One, the producer, produces some data and sends it to a parcer. The producer sends a HashMap[String,HashMap[Object,List[Int]]] through a message (along with this to mark the sender):
parcer ! (this,data)
The parser is constantly waiting for messages like so:
def act(){
loop{
re...
We have a memory intensive java applet that runs in IE. The client is trying to upgrade to IE8. They want to enable the security feature Enable memory protection to help mitigate online attacks. But when they do and try to access our application, they get the following error message: "– “Internet Explorer has stopped trying to res...
Hi all,
I'd like to build a C application that I can then exploit to get some confidential information from the kernel memory.
The issue is that I don't really understand where to start... I've found that the use of copy_to_user() without appropriate checks on the return value could lead to this sort of issue, but I don't understand ho...
When a value being returned from a function by ref is assigned to multiple variables, assignments after the first one seems to copy the value.
The code I used to test it is:
root@kelso:/tmp# php -r 'function &bar() {static $x; if (NULL === $x) {$x=range(1,99999);}; return $x;}; var_dump(memory_get_usage()); bar(); var_dump(memory_get_...
Hi,
I created a view controller with a png image and a long jpg background (it's width is twice the width of the iPad - 2048px). moving the png image makes the background image to move to the left in a seamless manner. see this image for an illustrative reference:
image
When playing with it on the iPad, it crashes anytime I move it mo...
Hi,
I don't really understand when I should be allocating memory on the heap and when I should allocate on the stack. All I really know is that allocating on the stack is faster, but since the stack is smaller I shouldn't use it to allocate large data structures; what other things should I take into account when deciding where to alloc...
I have created a UIScrollView (canvas.scrollview) and have a custom UIView (canvas) inside it.
A normal configuration for starting up is something like this:
CGRect cs2 = CGRectMake(0, 0, 4000, 4000);
CGPoint screen = {[UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height};
self.canvas.frame = cs2; //canv...
Hi everybody.
I have written a tool for database replication in PHP. It's working fine but there's one issue:
I'm using PDO to connect to the different databases to keep it independent of any specific RDBMS, which is crucial to this application.
The tool does some analysis on the tables to decide how to convert certain types and some ...
Hi there,
I have a UIImagePickerController as a synthesized property of my view controller.
In general it works fine (takeing/picking photos, calling back, etc). However, when I receive a memory warning (didReceiveMemoryWarning is called on the view controller), although the app seems to handle it gracefully (viewDidLoad gets called fo...
I am using JXL to write an excel file of 50000 rows and 30 columns.
My code looks like this:
for (int j = 0; j < countOfRows; j++) {
myWritableSheet.addCell(new Label(0, j, myResultSet.getString(1), myWritableCellFormat));
myWritableSheet.addCell(new Label(1, j, myResultSet.getString(2), myWritableCellFormat));
.....
.....
}
Whil...
I am using jQuery 1.2.6 to build up HTML elements in memory. The image below is a snippet of how I am doing it. When I profile the HTML that is generated, below is what I am seeing. Why is this happening? What about my jQuery is incorrect here?
...
I am having a WPF application where when I close a TabItem from TabControl using TabControl.Items.Remove(TabItem) does not free memory used by TabItem. It just makes TabItem invisible and TabItem object still remains in the memory. Is there any way to remove this TabItem object from memory ? Any help would be appreciated.
...
Hi,
What are some of the good tools for analysing memory (for footprint, allocation and deallocation)? I am familiar with valgrind. If there are tools apart from that, would be nice to know about them.
Best.
...
Hi,
I am using Visual Leak Detector to detect memory leaks in my program. When the program has finished running, I get an assertion triggered by the following code in utility.cpp. When Visual Leak Detector's header is excluded from the program, the program runs and exits without incident.
// Get the *real* address of the import. If we...
Say I instantiate 100 000 of Vectors
a[0..100k] = new Vector<Integer>();
If i do this
a[0..100k] = new Vector<Integer>(1);
Will they take less memory? That is ignoring whether they have stuff in them and the overhead of expanding them when there has to be more than 1 element.
...
I have a std::vector of a class called OGLSHAPE.
each shape has a vector of SHAPECONTOUR struct which has a vector of float and a vector of vector of double. it also has a vector of an outline struct which has a vector of float in it.
Initially, my program starts up using 8.7 MB of ram. I noticed that when I started filling these these...
I have two C functions, which basically operate on a stack data structure. This one pushes a value of type OBJ which is actually just unsigned long to the top of the stack. The stack is also grown if necessary.
OBJ Quotation_push_(CzState *cz, CzQuotation *self, OBJ object)
{
if ((self->size + 1) > self->cap) {
self->items =...