heap-memory

Runtime.getRuntime().freeMemory()

Does Runtime.getRuntime().freeMemory() return the free heap memory space or heap + non-heap memory space? ...

Can you please explain this C++ delete problem?

I have the following code: std::string F() { WideString ws = GetMyWideString(); std::string ret; StringUtils::ConvertWideStringToUTF8(ws, ret); return ret; } WideString is a third-party class, so are StringUtils. They are a blackbox to me. Second parameter is passed by reference. When I step through the debugger the line ret...

in C: Why does a stack allocated structure exist outside of the function?

my function: struct hostent * gethost(char * hostname){ if(/*some condition under which I want to change the mode of my program to not take a host*/){ return null } else{ struct hostent * host = gethostbyname(hostname); return host; } } in main: struct hostent * host = gethost(argv[2])...

tomcat as windows service - increase max java heap memory

i have tomcat5.5 installed as a windows service, and I need to change the java memory pool. however, when i enter any amount more than 1348 mb, the service doesn't start. IS there any way to get around this? Would it help if I installed it the non-windows-service way? TIA ...

What's the connection between the heap used in dynamic memory allocation and the data structure?

Possible Duplicate: Why are two different concepts both called heap? I've googled around, but cannot find the answer for this question; what's the connection between the heap used in dynamic memory allocation and the data structure? Is memory organized on the heap in a way which is similar the the heap data structure? If so, t...

JVM memory initializazion error after windows update

Hi all, I have three Windows Server 2003 with 2 GB RAM. Server1 tomcat 5.5.25 jvm version SUN 1.6.0_11-b03 Server2 tomcat 5.5.25 jvm version SUN 1.6.0_14-b08 Server3 tomcat 6.0.18 jvm version SUN 1.6.0_14-b08 For the three servers JVM parameters are: -XX:MaxPermSize=256m -Dcatalina.base=C:\Apache Group\apache-tomcat-5.5.25 -Dcata...

Avoid an "out of memory error" in Java(eclipse), when using large data structure?

OK, so I am writing a program that unfortunately needs to use a huge data structure to complete its work, but it is failing with a "out of memory error" during its initialization. While I understand entirely what that means and why it is a problem, I am having trouble overcoming it, since my program needs to use this large structure and ...

Visual Studio - how to find source of heap corruption errors

Hi, I wonder if there is a good way to find the source code that causes a heap corruption error, given the memory address of the of the data that was written 'outside' the allocated heap block in Visual Studio; Dedicated (0008) free list element 26F7F670 is wrong size (dead) (Trying to write down some notes on how to find memory error...

Compute jvm heap size to host web application

Hello, I want to host a web application on a private JVM they offer 32, 64, 128, 256 MB plans. My web application uses Spring. And I store some objects for every logged in user session. My question is: How can I profile my web app to see how much heap size it needs so I can choose a plan?, How can I simulate hundreds of users logged in...

Detect application heap size in Android

How do you programmatically detect the application heap size available to an Android app? I heard there's a function that does this in later versions of the SDK. In any case, I'm looking for solution that works for 1.5 and upwards. ...

Out of memory error in java

I am getting OutOfMemoryError: java heap snippets of the method: { // step 1: I am creating a 2 dim array int totalCombination = (int) Math.pow(2.0, (double) vowelCount); // here vowelCount > 10 // step2: initializing my array // step3: and using that array } My Question: each time this method is called, that array is getting cr...

How to increase Java heap space for a tomcat app

There are lots of questions that ask this or a similar question. They all give the command that has to be executed, what I don't understand is where do I write this command. I want to permanently increase the heap space for my tomcat apps. I read this page http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html ...

How to trigger a Symbian C++ application within a J2ME application for Nokia phones using J2ME API?

Hi all, Anyone knows how to trigger a Symbian C++ application using any J2ME API call? I have a J2ME application that needs a customized photo taking application in Symbian C++. The reason for separating into two applications is because J2ME has a limit in heap size and the J2ME needs to know the path of photo after taking it. Thanks a...

operator "new" returning a non-local heap pointer for only one class ?

Language : C++ Platform : Windows Server 2003 I have an exe calling a DLL. EDIT : (exe is not doing anything, it calls few global function which does everything related to DLL within DLL. It does not explicitly new any of DLL classes) I allocate (new) the memory for class A within the DLL, it returns me a non-local heap pointer. I...

getting java.lang.OutOfMemoryError exception while running a Midlet (using netbeans)

I am writing a Midlet(using Netbeans) which reads a file containing exactly 2400 lines (each line being 32 characters long) and (extract a part of each line) puts them in an array. I am doing the same for 11 such files( all files have exactly 2400 lines).The Midlet runs fine for reading 6 files and putting them in 6 arrays. However, the ...

How can a 1Gb Java heap on a 64bit machine use 3Gb of VIRT space?

I run the same process on a 32bit machine as on a 64bit machine with the same memory VM settings (-Xms1024m -Xmx1024m) and similar VM version (1.6.0_05 vs 1.6.0_16). However the virtual space used by the 64bit machine (as shown in top under "VIRT") is almost three times as big as that in 32bit! I know 64bit VMs will use a little more m...

Where my memory is alloced, Stack or Heap, Can I find it at Run-time?

I know that memory alloced using new, gets its space in heap, and so we need to delete it before program ends, to avoid memory leak. Let's look at this program... Case 1: char *MyData = new char[20]; _tcscpy(MyData,"Value"); . . . delete[] MyData; MyData = NULL; Case 2: char *MyData = new char[20]; MyData = "Value"; . . . delete[] M...

Retrieve Heap memory size and its usage statistics etc...?

Lets say I open some application or process. Did some work with that. Now I closed it. Need to know whether this application caused any memory leak. i.e used up some heap memory and not cleared it properly. Can I get this statistics some how? I'm using Visual Studio (for development) under Windows OS. Even I would be interested in kno...

Java heap space Xmx Xms parameters ignored

Hi, I have a .JAR that apparently uses up too much memory, and throws an exception "Java heap space" (or something similar). So I tried running the .JAR via the CMD like this: C:\MyFolder>javaw -jar MyJar.jar -Xms64m -Xmx128m That did not solve the problem. Same error. Now, when I checked the Processes tab in the windows task manager...

Exploring Virtual Memory (ProcessWalker)

I was reading this article on MSDN "Managing Heap Memory in Win32" And in it they are explaining about a tool called ProcessWalker.exe In the article they explained that they can use this tool to explore the contents of virtual memory of any process. Does anyone know where I can download this tool from. Or maybe ProcessWalker might b...