memory

Is runtime stack kept in data segment of memory?

I'm very curious of the stack memory organization after I experiment what's going on in the background and obviously saw it's matching with tiny knowledge I acquired from books. Just wanted to check if what I've understood is correct. I have a fundamental program -- has 2 functions, first one is foo and the other is main (the entry poin...

Can someone verify that this is an IE8 memory leak?

The leak is pretty easy to create. Place the HTML below alongside a list of large images named "TestImage0.jpg", "TestImage1.jpg",..."TestImage9.jpg". The page will leak memory (I used sIEve for testing) on every click of the page. If the resize css is removed, the page will not leak. Can anyone confirm that this is an IE8 problem, or th...

Whats is going on with memory allocation here?

While trying to discover the max size of a Java String array on my machine I ran into some interesting results, here is the code, String [] max; int i = 15444000; while(true){ try{ max = new String[i]; System.gc(); Thread.sleep(10); }catch(InterruptedException e){} i += 1; System.out...

What is the easiest way to have a custom file implementation that only uses memory in Java

I have a code base that makes extensive use of files to represent a single data object. I have refactored the code so that the data object is now an explicit java object that mostly hides interaction with the underlying file system. However, we use a few external tools (like Weka), that read and write files. Ideally, I would like to...

Powershell. C# Measuring powershell host memory usage.

Hi, I'm automating the usage of powershell scripts from C# using the powershell async pipeline invoke and I notice that when I execute script over and over again, using the same runspace, the .vhost.exe memory usage goes up and up and up, and it would run out of memory after a days operations. Is there a way to measure how much me...

Save memory when storing duplicate strings in a vector?

I'm using C++ and it's STL. I have a large (100MB+) text file. This file just has a lot of "words" (strings separated by whitespace) like: sdfi sidf ifids sidf assd fdfd fdfd ddd ddd I need to put each of these "words" in a vector: vector<string> allWordsInFile; So for each word that I read from the file, i do: allWordsInFile.pu...

How to get free memory info from Java

I use the following lines to get the memory usage with Java : Free_Memory=Run_Time.freeMemory()/1048576; // 1024 x 1024 = 1K x 1K = 1Meg Total_Memory=Run_Time.totalMemory()/1048576; // 992 Total on a 4 GB PC The Free_Memory I got was : 900, but it is way off, when Free_Memory goes down to around 600, my program ran o...

When does a mutable state value freed from heap?

On F# WikiBook under Encapsulating Mutable State section, there is a following code snippet. > let incr = let counter = ref 0 fun () -> counter := !counter + 1 !counter;; val incr : (unit -> int) > incr();; val it : int = 1 > incr();; val it : int = 2 > incr();; val it : int = 3 At first, it seemed easy eno...

memory profiler for c++

Im trying to find a tool that can help me find out where my memory is allocated in a certain stage of my program. Most memory profilers cant do this and just tell you if memory is leaked or not. Does any one know of a tool that can do this? Edit: OS: Win32 Visual studio 2005 ...

Reading arbitrary memory locations? Possible?

Is there a way to (read-only) access any arbitrary memory location without running into an access violation? I thought that each process has its own virtual adress space and that it can read all available memory locations...seems not to be the case, since my program hangs if I do something like var IntPtr : PInteger; AnInteger : Int...

Reading Object's Memory Address

I'm trying to pass a business object from one WinForm to another WinForm for modification, and then repopulate the text boxes, etc. on the first form with the updated values. However, it seems that the object values set in the second form are not "sticking" when the code control returns to the first form. Is there a way to view the me...

iPhone Memory Management

Dear friends, I'm about to make a fool out of myself, but I've noticed many friendly and patient people around here, so I just give it a try: I'm developing an iPhone app, that contains a database of car reviews. I want the user to be able to share the reviews by email. So, when he/she finds an interesting car in the app, he/she would ...

Explicitly freeing memory in c#

Hi, I've create a c# application which uses up 150mb of memory (private bytes), mainly due to a big dictionary: Dictionary<string, int> Txns = new Dictionary<string, int>(); I was wondering how to free this memory up. I've tried this: Txns = null; GC.Collect(); But it doesn't seem to make much of a dent in my private bytes - they d...

iPhone - Blank Screen when Switching VIews

I have an application that makes use of drill-down views, tabbars, etc. I'm also making use of the UIImagePicker, as well as Route-Me for mapping support. Normally, the application performs fine. However, I find that if I perform a lot of activities and then switch between views, I end up with a blank screen and my view is not drawn. ...

Why this code doesn't allocate memory in C?

Updated question is here http://stackoverflow.com/questions/828108/please-help-me-to-solve-this-memory-allocation-problem I'm working on making a HashTable in C. This is what I've done. I think I'm going on a right path but when I'm trying to main.c HashTablePtr hash; hash = createHashTable(10); insert(hash, "hello"); insert(hash, "...

Memory allocation problem in HashTable

Please don't close this saying a duplicate question. I made an important change so not to confuse people, I resubmitted this much clearer codes. Please help me to solve this memory allocation problem. I'm working on a HashTable and this is what I've (partial codes only) main.c HashTablePtr hash; hash = createHashTable(10); insert(hash...

Optimizing Class Size in Delphi. Is there something like "packed classes"?

I'm trying to optimize the size of my Delphi classes so that they take up as less memory as possible cause I'm creating a great number of them. The thing is, the classes themselves are pretty small but they aren't taking the space I was expecting. For example if I have type MyClass = class private mMember1 : integer; mMember2...

How can I use a page table to convert a virtual address into a physical one?

Lets say I have a normal page table: Page Table (Page size = 4k) Page #: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Page Frame #: 3 x 1 x 0 x 2 x 5 x 7 4 6 x x x How can I convert an arbitrary logical address like 51996 into a physical memory address? If I take log base 2 (4096), ...

64 bit large mallocs

What are the reasons a malloc() would fail, especially in 64 bit? My specific problem is trying to malloc a huge 10GB chunk of RAM on a 64 bit system. The machine has 12GB of RAM, and 32 GB of swap. Yes, the malloc is extreme, but why would it be a problem? This is in Windows XP64 with both Intel and MSFT compilers. The malloc sometim...

Winform memory spike

Hi, I have the following issue. I have deployed a smart client application to several users. Memory usage is adequate for all of them except one. For this particular user the memory usage is 2 to 2 1/2 times the usage than for any other user. The desktop specs are the same as for the other users. The computer was defragged not long ago. ...