Following is the scenario i need to solve. I have struck with two solutions.
I need to maintain a cache of data fetched from database to be shown on a Swing GUI.
Whenever my JVM memory exceeds 70% of its allocated memory, i need to warn user regarding excessive usage. And once JVM memory usage exceeds 80%, then i have to halt all the da...
Is there a way to find how much memory is used for a particular object? For example a List. Taking everything into account, like string interning and whatever is done by compiler/runtime environment/whatever.
...
I am debugging some memory problems related to a managed application that we have. I was monitoring the application using perfmon when I got confused about the memory difference between the .NET Bytes in All Heaps and the Working Set reported in Process Explorer (Mem Usage column in case of Task Manager). The Bytes in all heaps counter d...
What is the memory overhead of having an empty vector vs having a pointer to a vector?
Option A:
std::vector<int> v;
Option B:
std::vector<int> *v = NULL;
I believe that option B takes 1 32 bit pointer (assuming 32 bit here)
How much memory does the empty 'v' take up?
...
I should first say that I'm pretty familiar with configuring Eclipses memory settings. I'm currently using a variant of one of the posted configurations:
...
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx512m
-Xss2m
-Djava.net.preferIPv4Stack=true
-Dcom.sun.management.jmxremote
And according to JConsole and the internal heap monito...
When deallocing a refrence I've seen release and dealloc being used for example
-(void)dealloc
{
[foo release];
[nar dealloc];
[super dealloc];
}
My question is when is release to be used and when is dealloc to be used?
Thanks
...
I have been facing a weird issue in a piece of code.
void app_ErrDesc(char *ps_logbuf, char *pc_buf_err_recno)
{
char *pc_logbuf_in;
char rec_num[10];
char *y = "|";
int i, j;
memset(rec_num, 0, sizeof(rec_num));
memset(pc_buf_err_recno, 0, LOGBUFF);
.....
.....
}
For some reason the first me...
Can I control the memory limit (i.e. when GC has to run) in my Flex application?
...
Hello, I currently have a set-up that goes as such:
I have a bunch of "client" point of sale systems that periodically send new sales data to one centralized "HQ", which stores the data into one big database for report generation.
The client POS is based on PHPPOS, and I have implemented a module that uses the standard XML-RPC library ...
I have a problem with a java application running under linux.
When I launch the application, using the default maximum heap size (64mb), I see using the tops application that 240 MB of virtual Memory are allocated to the application. This creates some issues with some other software on the computer, which is relatively resource-limited...
Are there any tools available in Linux which graphically or textually display memory usage for a program? For example, if I write a C++ program and would like to verify that objects are being allocated and deallocated properly in memory, are there applications available that would visually show the objects being instantiated and deleted...
Duplicate
http://stackoverflow.com/questions/33978/find-out-how-much-memory-is-being-used-by-an-object-in-python
I am using ipython to run my code. I wonder if there is any module or command which allow me to check the memory usage of an object. For instance:
1> a = range(10000)
2> %memusage a
1MB
Something like %memusage and r...
A colleague has been trying to reduce the memory footprint of a 32 bit app running on vista 64 and has noticed some weird behaviour in the reported size of the private working set.
He made some changes and recompiled the app. Then he ran the app and loaded in a data file. The task manager reports that private working set is 98Mb. He the...
I have been googling for awhile now and cannot discover if there is a generic way to see what type of memory (pc2700, pc3200, etc.) is used within a given workstation. Does anyone know how to extract this information?
...
Suppose I have a function that allocates memory for the caller:
int func(void **mem1, void **mem2) {
*mem1 = malloc(SIZE);
if (!*mem1) return 1;
*mem2 = malloc(SIZE);
if (!*mem2) {
/* ... */
return 1;
}
return 0;
}
I'd like to hear your feedback on the best way to free() the allocated memory i...
I have an asp.net application that serializes data to the client using JSON. Once load reaches a certain level, the app is spending an in-ordinate time in GC and after spending some time with WinDbg/SOS and related tools it appears that there is a substantial amount of LOH fragmentation taking place because the size of the generated JSO...
The following code is generating a stack overflow error for me
int main(int argc, char* argv[])
{
int sieve[2000000];
return 0;
}
How do I get around this? I am using Turbo C++ but would like to keep my code in C
EDIT:
Thanks for the advice. The code above was only for example, I actually declare the array in a function and...
Do you think having a great memory is REQUIRED to be a great programmer?
I don't consider myself a great programmer but I do think I am decent. But my memory is REALLY bad so I find myself always having to remind myself how to do things. I mean I "know where to look" but sometimes it makes me feel like I am just a crappy programmer. Wh...
I am very eager to study best practices when it comes to space hardening. For instance, I've read (though I can't find the article any longer) that some core parts of the Mars rovers did not use dynamic memory allocation, in fact it was forbidden. I've also read that old fashioned core memory may be preferable in space.
I was looking a...
What does the register keyword do in C? I have read that it is used for optimizing but is not clearly defined in any standard. Is it still relevant and if so, when would you use it?
...