I have a java program that uses a weak hashmap for caching some things, if java needs more memory the weak hashmap is cleared. This works fine for me. Now I also have a c# program on the same computer running and recognized the following.
When the java program is running my c# program is not running correctly at times when the computer ...
Hi,
I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a -Xmx2g (or -Xmx2048m) I get an error "Failed to create the Java Virtual Machine".
1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the st...
I've heard the term "memory fragmentation" used a few times in the context of C++ dynamic memory allocation. I've found some questions about how to deal with memory fragmentation, but can't find a direct question that deals with it itself. So:
What is memory fragmentation?
How can I tell if memory fragmentation is a problem for my ap...
It seems only 1 memory breakpoint can be set, and it seems doesn't matter at which line the memory breakpoint is set,very weird,anyone can explain?
...
I have an ActiveX control which has a function for opening a document directly from memory. The function has the following signature:
Public Overridable Function OpenPDFFromMem(ByVal lpPDFData As Integer, ByVal nPDFDataLen As Integer, ByVal lpszUserPwd As String, ByVal lpszOwnerPwd As String) As Boolean
How do I load the document in me...
struct MyRect
{
int x, y, cx, cy;
char name[100];
};
int main()
{
MyRect mr;
mr.x = 100;
mr.y = 150;
mr.cx = 600;
mr.cy = 50;
strcpy(mr.name, "Rectangle1");
MyRect* ptr;
{
unsigned char bytes[256];
memcpy(bytes, &mr, 256);
ptr = (MyRect*)bytes;
}
printf("X = %d...
Hey I'm testing out Runtime.freeMemory() with this code:
Runtime runtime = Runtime.getRuntime();
long freeMemory = runtime.freeMemory();
// This is some arbitary factor that should work <= 1
double factor = 0.8;
int size = (int) (factor * freeMemory);
byte[] testArray = new byte[size];
I'm creating a byte array of size close t...
I have checked all posts here, but can't find a solution for me so far.
I did setup a small service that should only watch if my other services I want to monitor runs, and if not, start it again and place a message in the application eventlog.
The service itself works great, well nothing special :), but when I start the service it use a...
I am messing with multiple threads accessing a resource (probably memory). What does "readback" mean in this context?
Any guides will be helpful... Google didn't give me any good results.
...
My question is about memory use and objects in actionscript 2. If I have a class definition:
class test1{
public function one(){trace("Hello");}
public function two(){trace("World");}
}
And a second class definition:
class test2{
static public function one(){trace("Hello");}
static public function two(){trace("Worl...
I am working on VB.net multiuser application and when ever my any form open up memory rise and after some time out of memory exception is come.
I am working on VB.net 2008 and sqlserver 2005.
I have use very much of shared object so second time it memory allocation is less,
but how i can reduce it when form is close or not in use.
can i...
I have to write a Windows service that handles at some point confidential data (such as PIN codes, passwords, and so on). Those informations are needed for a very short amount of time: usually they are sent almost immediately to a smart card reader.
Lets consider this piece of code:
{
std::string password = getPassword(); // Get the ...
This question follows a suggestion made by @sharptooth in this related question.
Can std::string be tweaked so that it becomes password-safe ?
If not, what would be the guidelines to write a password-handling class (thus a class that takes big care about what it writes to memory and clears it before destruction) ?
...
Say I have defined a variable like this (C++):
static const char str[] = "Here is some string data";
And I have a statically allocated class instance which references this array in its destructor, can this go wrong? E.g. could the str variable somehow get invalid?
class A {
~A() {
cout << str << endl;
}
};
static A a;
My assu...
I just read this question and the accepted answer: http://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection
In the answer, Noldorin referenced some guidelines from apple. Here is the part I'm concerned with:
Use delete statements. Whenever you create an object using a new statement, pair it with a delete sta...
Hi Experts,
I have a class that has int[] members. The arrays grow very big, about 56M in size.(arrays are expandable with implementation similar to arraylist). Now I want to partially store the array in database, to improve memory. I have oracle database at my disposal. I would also like to cache more used indexes. I am wondering if ...
How can I purposely overflow my memory, to force garbage collection?
Can someone propose algorithm like this:
while ( garbage collector starts ) {
overflow my memory with something easily disposable
}
Edit:
To everyone that purposed GC.Collect method. I've always tought, that GC can not be forced to occur programmaticaly. Guess,...
I have a problem with an Objective-C object (in an iOS game app) that is being mysteriously deallocated.
The object is a GameCharacter instance which is instantiated like so:
for (int c = 0; c < kNrOfGuards; c++) {
GameCharacter* guard = [[GameCharacter alloc] initGuard:self sprite:guardSprite];
[characterArray addObject:guard]...
Hey all.
Would anyone be able to give me a quick primer on how memory resources are used? I know I can up the PHP memory limit in PHP.ini as well as through lines of code such as:
ini_set("memory_limit","24M");
I have an image upload script that I'm writing that is making use of a pretty cool PHP script called simpleImage which ...
I have a table with for columns, a smallint, an integer and two floats. Expected memory for each row is 14bytes (2+4+2*4).
I have around 700,000 rows in my table. I've set no primary keys and indices.
While the MyIsam type takes around 10MB (average of 15b for each row), the InnoDB type takes more than 30Mb (average of 44b).
What am...