Hello everyone,
I've got a problem with the following (very simple) code:
void foo()
{
void[] dat=new void[50_000_000]; // allocate 50 MByte of dummy-data
delete dat;
}
after I called foo() and watched the memory usage in the windows taskmanager,
the program blowed up to 50 MBytes al
On Fri, Jul 3, 2009 at 4:30 PM, AxelS wrote:
> Hello everyone,
> I've got a problem with the following (very simple) code:
>
> void foo()
> {
> void[] dat=new void[50_000_000]; // allocate 50 MByte of dummy-data
> delete dat;
> }
>
> after I called foo() and watched the memory usage in th
Reply to AxelS,
Hello everyone,
I've got a problem with the following (very simple) code:
void foo()
{
void[] dat=new void[50_000_000]; // allocate 50 MByte of
dummy-data
delete dat;
}
after I called foo() and watched the memory usage in the windows
taskmanager, the program blowed up to 50 MByte
AxelS:
> void[] dat=new void[50_000_000]; // allocate 50 MByte of dummy-data
I am not sure, but the GC may scan that chunk of voids. If you need a raw block
it may be better to work with an array of uint.
> Why can't the GC remove that data and how CAN I remove it?
If you really need to
BCS Wrote:
> You can't. The D runtime (and most other runtimes) don't ever reduce the
> amount of memory they keep in the heap. If you where to allocate another
> 25MB right after that function you would see no change in the memory usage.
> The good news is that with virtual memory, all of that
BCS wrote:
> ... The good news is that with virtual memory, all of that has almost
> zero cost. What matters is how much ram you are actively using.
You've obviously never used a netbook with no swap file. :)
AxelS escribió:
BCS Wrote:
You can't. The D runtime (and most other runtimes) don't ever reduce the
amount of memory they keep in the heap. If you where to allocate another
25MB right after that function you would see no change in the memory usage.
The good news is that with virtual memory, a
@Ary Borenszweig: Good idea but I can't pipe data to a HTTP-server located
somewhere in the internet...
OK, I tried it with C's malloc and free - but everytime I access my array, D
puts the memory into its heap...I'm getting crazy because of this!
ubyte[] data=cast(ubyte[])malloc(50_000_000)[0
AxelS wrote:
> @Ary Borenszweig: Good idea but I can't pipe data to a HTTP-server located
> somewhere in the internet...
I believe he means to read the file in chunks, sending them across the
network as you get them.
> OK, I tried it with C's malloc and free - but everytime I access my array,
Hello Daniel,
BCS wrote:
... The good news is that with virtual memory, all of that has almost
zero cost. What matters is how much ram you are actively using.
You've obviously never used a netbook with no swap file. :)
Nope, my netbook has a swap file, and I've never heard of one befor (
Hello AxelS,
BCS Wrote:
You can't. The D runtime (and most other runtimes) don't ever reduce
the amount of memory they keep in the heap. If you where to allocate
another 25MB right after that function you would see no change in the
memory usage. The good news is that with virtual memory, all o
BCS wrote:
> Hello AxelS,
>
>> BCS Wrote:
>>
>>> You can't. The D runtime (and most other runtimes) don't ever reduce
>>> the amount of memory they keep in the heap. If you where to allocate
>>> another 25MB right after that function you would see no change in the
>>> memory usage. The good news i
@downs:
That's what I even had beforejust allocate and release memory is not
difficult - just if you want to access the data the GC copies all the memory
into its heap...
I found a new way which is really good and easy:
Just use the Win32 Memory API for allocating and releasing your data
wi
downs wrote:
BCS wrote:
Hello AxelS,
BCS Wrote:
You can't. The D runtime (and most other runtimes) don't ever reduce
the amount of memory they keep in the heap. If you where to allocate
another 25MB right after that function you would see no change in the
memory usage. The good news is that
AxelS wrote:
@downs:
That's what I even had beforejust allocate and release memory is not
difficult - just if you want to access the data the GC copies all the memory
into its heap...
Can you recommend a good crack dealer? ;)
Seriously, there are no GC calls associated with memory acces
Hello Jérôme,
Like BCS said, the only way to make sure that the memory will be
returned is to use mmap/munmap directly (or their equivalent on your
platform).
That maybe true, but it wasn't my point. What I was trying to get at was
that if you want to load a file into a buffer then asking mma
On Sat, 04 Jul 2009 05:11:39 -0400, Daniel Keep
wrote:
BCS wrote:
... The good news is that with virtual memory, all of that has almost
zero cost. What matters is how much ram you are actively using.
You've obviously never used a netbook with no swap file. :)
Swap files are needed for
Reply to Steven,
On Sat, 04 Jul 2009 05:11:39 -0400, Daniel Keep
wrote:
BCS wrote:
... The good news is that with virtual memory, all of that has
almost zero cost. What matters is how much ram you are actively
using.
You've obviously never used a netbook with no swap file. :)
Swap file
18 matches
Mail list logo