Hi all,
In your actual programming experience, how did this knowledge of STACK and HEAP actually rescue you in real life? Any story from the trenches? Or is this concept good for filling up programming books and good for theory?
...
I have a PHD format heap dump from an IBM jvm and I wish to examine the values of some strings. With the Sun JVM's binary hprof dumps this is possible, but I haven't been able to recover this information from an IBM dump.
I've tried:
Eclipse Memory Analyzer (0.8.0.200906170940) with IBM's DTFJ Portal Heap Dump Reader (1.3.0.2009032416...
I have IBM's J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3) installed. After getting an OOM, the size of the heap dump is 383MB. How much heap does the JVM have?
The reason why I ask is that a 400MB heap dump seems a bit much for the default 64MB heap that I expect but I didn't specify any -Xm options. Does J9 use a different default heap siz...
hello, i'm trying to populate the heap with a string array, but the console gave me nothing when i compiled. I don't know what I did wrong...
void spellCheck(char article[], char dictionary[]) {
int i = 0;
char* tempArticle;
while ( article[i] != '\0'){
i++;
}
tempArticle = malloc(i);
i=0;
while (article...
hello everyone. I'm a beginner to C programming. I'm trying to learning how to code a spell checker that looks through all the words in a dictionary file, compare them with an article, print out all the words that do not exist in the dictionary file onto the console. Since I'm studying malloc in class, I've lowercased every word, removed...
I'm developing a VC++ NT service that is meant to operate continuously for many months. It uses VC++ runtime heap intensively. Clearly heap fragmentation can at some point cause it malfunctioning (thinking it's out of memory).
What tests can I run on my service to estimate the degree it is prone to heap fragmentation?
...
is there an efficient algorithm for merging 2 max-heaps (stored as an array)?
...
Consider the following code:
class myarray
{
int i;
public:
myarray(int a) : i(a){ }
}
How can you create an array of objects of myarray on stack and how can you create an array of objects on heap???
...
I've been instructed to write a model strdup by creating a String struct on the heap the holds a copy of the source. I think I have successfully coded the strdup, but I'm not sure if I've created a Struct on the heap...
typedef
struct String {
int length;
int capacity;
unsigned check;
char ptr[0];
} String;
char* model...
Hi,
Whenever any new object is created, the object is created on heap. The memory allocated for each object has two additional fields 1) The type object pointer 2) sync block index.
What exactly is the usage of these two fields. Can anybody shed light on this?
Thanks,
Justin Samuel.
...
int length = strlen(src);
char *structSpace = malloc(sizeof(String) + length + 1);
String *string = (String*) structSpace;
int *string = (int*) structSpace;
*I created a struct called String
...
I'm trying to check a in the heap with char* c = s - sizeof(unsigned);
But it always returns gibberish to me. I'm wondering what did I do wrong...
typedef
struct String {
int length;
int capacity;
unsigned check;
char ptr[0];
} String;
char* modelStrrealloc(char* myStruct, int new_capacity){
char* c = ...
Hi, I'm trying to track down a crash that happens when I stress my C# code and run in low memory conditions. However, in some cases, instead of getting OutOfMemoryException, my program will simply crash and exit. This is usually caused by memory corruption from overrunning a buffer or because of stack overflow (or corruption).
So, is th...
I need to detect whether the file I am attaching to an email is exceeding the server limit. I am not allowed to increase the JVM heap size to do this since it is going to affect the application performance.
If I don’t increase the JVM heap size, I will run into OutOfMemoryError directly.
I would like to know how do allocate the memory...
Hi,
What i usually do concerning the jvm heap size is setting the max value really high to avoid the infamous OutOfMemoryException.
However, this strategy (or lack of strategy) doesn't seem to be really smart. :-).
My question is how to choose the min and max values, and the difference between the two (should max-min be small or big?...
I wonder if stack size can grow like heap does during runtime?
...
I'm having an out of memory error. I have a large range of inputs (2^40), that is too large to hold at once. Each input is a String[].
Instead, I thought I'd run my test program on each input, write the results to a file, then discard the input. The length of the longest input is 42, so that isn't an error causing the overflow. I don't...
I am getting OutOfMemoryErrors when uploading large (>300MB) files to
a servlet utilizing Commons FileUpload 1.2.1. It seems odd, because
the entire point of using DiskFileItem is to prevent the (possibly
large) file from residing in memory. I am using the default size
threshold of 10KB, so that's all that should ever be loaded into the
...
Hello again,
I am trying to use priority_queue, and program constantly fails with error message HEAP CORRUPTION DETECTED.
here are the snippets:
class CQueue { ...
priority_queue<Message, deque<Message>, less<deque<Message>::value_type> > m_messages;
...};
class Message has overloaded operators > and <
Here I fill up ...
I have heard several people claiming that you can not scale the JVM heap size up. I've heard claims of the practical limit being 4 gigabytes (I heard an IBM consultant say that), 10 gigabytes, 32 gigabytes, and so on... I simply can not believe any of those numbers and have been wondering about the issue now for a while.
So, I have thr...