Hello all,
Are there any memory leaks when I throw exception from contructor like this:
class Wictim
{
public string var1 = "asldslkjdlsakjdlksajdlksadlksajdlj";
public Wictim()
{
//throw new Exception("oops!");
}
}
Will the failing objects be collected by garbage collector.
...
There are several ways that developers can get caught out by unintentional resource leaks in .NET. I thought it would be useful to gather them in one place.
Please add yours with one answer per item, so the best get voted up :)
...
Hello,
I'm working on a simple ASP .NET health checker and I've run into a few obstacles.
1) I need to be able to get the full non-paged memory usage from a remote machine (on same network). I've tried using System.Diganostics.Process.NonpagedSystemMemorySize64 however I've come to realize that the kernel's nonpaged usage is going to b...
For example, say I have a class Temp:
class Temp
{
public:
int function1(int foo) { return 1; }
void function2(int bar) { foobar = bar; }
private:
int foobar;
};
When I create an object of class Temp, how would I calculate how much space it needs, and how is it represented in memory (e.g.| 4 bytes for foobar| 8 bytes for function1 | ...
I know maybe the answer to the question is obvious. But if anybody can give me a definitive answer, that would be helpful.
The question is : whether the java NIO package can provide some memory consistency assurance?
The scenario is :
Thread A Thread B
[modify Object X] ...
Hi All,
My PC has 2GB RAM memory.
When I form a 3D mesh object having an array of 70.000 items in C# 2008 Express Edition, I get the error message "Stack Overflow exception handled...". If I upgrade RAM memory from 2GB to 4 GB, can I overcome this error message ?
Thanks in advance.
Regards.
Oner YILMAZ
...
I need a suggestion on on how do I copy a block of memory efficiently, in single attempt if possible, in C++ or assembly language.
I have a pointer to memory location and offset. Think of a memory as a 2D array that I need to copy consisting of rows and columns.
...
Hello,
I have few questions regarding Cache memories used in Multicore CPUs or Multipprocessors systems. (Although not directly related to programming, it has many repurcussions while one writes software for multicore processors/multiprocessors systems, hence asking here!)
1.) In a multiprocessor system or a multicore processor(Intel Q...
Hi all,
When javascript is run in a browser
alert('Hello World');
What environment executes it and manages it in memory?
I know this is vaugue! But thats the best place to start!
...
I have a program that uses way too much memory for allocating numerous small objects on heap. So I would like to investigate into ways to optimize it. The program is compiled with Visual C++ 7.
Is there a way to determine how much memory is actually allocated for a given object? I mean when I call new the heap allocates not less than th...
I'm writing an installer that will tune the configuration of the product for the particular hardware on which it will be run. In particular, I want to determine how much physical RAM is installed in the system so I can estimate how much memory to allocate to the product when it runs.
Ideally, I'd like to do this in a platform-independe...
Greetings - I am trying to set and store values in memory... and be able to share them between classes. I've tried two different methods with not too much luck -- one with 'dot' syntax and one with [].
Generally: In class1 I have something like this:
#import <Foundation/Foundation.h>
@class Class1;
@interface Class1 : NSObject {
...
I am currently attempting to deal with an issue with releasing a FlowDocument resources. I am loading an rtf file and putting it into a FlowDocument with TextRange.Load. I noticed that after it does this it holds onto those resources and GC doesn't collect it. I have ran a memory profiler and have seen that this is true. I have also narr...
After reading an article in the most recent issue of MSDN magazine, I wanted to try using VADump to break down the memory usage of some applications I've written.
The only copy of the executable on my PC is at:
c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin\winnt\vadump.exe
No matter what combination of arguments I g...
I have to load a lot of data from BlazeDS and/or Livecycle DS service to Adobe Flex and would like to find out what's available from memory stand point. This is similar to querying in java: long heapSize = Runtime.getRuntime().totalMemory()
...
A global variable's scope is in all the files.. while a static global variable's scope is just the file where it is declared.. why so ? where are global or static global variables stored in memory ?
...
In my course, I am told:
Continuous values are represented
approximately in a memory, and
therefore computing with floats
involves rounding errors. These are
tiny discrepancies in bit patterns;
thus the test e==f is unsafe if e
and f are floats.
Referring to Java.
Is this true? I've used comparison statements with doub...
I have encountered a problem in a C program running on an AVR microcontroller (ATMega328P). I believe it is due to a stack/heap collision but I'd like to be able to confirm this.
Is there any way I can visualise SRAM usage by the stack and the heap?
Note: the program is compiled with avr-gcc and uses avr-libc.
Update: The actual prob...
Mason asked about the advantages of a 64-bit processor.
Well, an obvious disadvantage is that you have to move more bits around. And given that memory accesses are a serious issue these days[1], moving around twice as much memory for a fair number of operations can't be a good thing.
But how bad is the effect of this, really? And what ...
CODE:
struct Stringdata
{
// Length of data in buffer.
size_t len;
// Allocated size of buffer.
size_t alc;
// Buffer.
char data[1];
};
typedef std::list<Stringdata*> Stringdata_list;
Stringdata_list strings_;
Stringdata *psd = this->strings_.front();
//...
if (len > psd->alc - psd->len)
alc = sizeof(Stringdata) + buffer_...