On Tue, 07 May 2013 19:09:28 -0400, Matic Kukovec
wrote:
Hi
I'm running Windows Vista 64 with dmd 2.062.
I have a simple program:
import std.stdio, core.memory, std.cstream;
void main()
{
string[] temp_array;
for(int i=0;i<500;i++)
{
++temp_
I found this problem with a program that reads a large xml file
(25+ lines), then stores the lines in a string[], does a
comparison with another array and finally clears the original
array.
On the second or third file I always get an OutOfMemoryError,
when the Task Manager shows about 1.3GB
Why isn't the memory deallocating?
The memory might be free, but still not released to the OS.
Especially in windows, when you free memory it still isn't freed
from
your process.
But you can reuse it in your program if the GC has collected it.
The correct test would be to copy and paste the
Matic Kukovec:
The system is Windows Vista 64bit. DMD is 2.062.
DMD doesn't yet produce 64 bit binaries on Windows.
I have tried to solve your problem using GC.free, but I am not
seeing good results...
Bye,
bearophile
On Tuesday, 7 May 2013 at 23:58:53 UTC, Ali Çehreli wrote:
On 05/07/2013 04:42 PM, Matic Kukovec wrote:
> On Tuesday, 7 May 2013 at 23:31:41 UTC, Ali Çehreli wrote:
>> On 05/07/2013 04:18 PM, Matic Kukovec wrote:
>>
>> > On Tuesday, 7 May 2013 at 23:14:20 UTC, Ali Çehreli wrote:
>> >> GC.minimiz
On 05/07/2013 04:42 PM, Matic Kukovec wrote:
> On Tuesday, 7 May 2013 at 23:31:41 UTC, Ali Çehreli wrote:
>> On 05/07/2013 04:18 PM, Matic Kukovec wrote:
>>
>> > On Tuesday, 7 May 2013 at 23:14:20 UTC, Ali Çehreli wrote:
>> >> GC.minimize() may work.
>>
>> > Tried it, no changes.
>>
>> Works for
On Tuesday, 7 May 2013 at 23:31:41 UTC, Ali Çehreli wrote:
On 05/07/2013 04:18 PM, Matic Kukovec wrote:
> On Tuesday, 7 May 2013 at 23:14:20 UTC, Ali Çehreli wrote:
>> GC.minimize() may work.
> Tried it, no changes.
Works for your test program under Linux but as the
documentation says, it is
On 05/07/2013 04:18 PM, Matic Kukovec wrote:
> On Tuesday, 7 May 2013 at 23:14:20 UTC, Ali Çehreli wrote:
>> GC.minimize() may work.
> Tried it, no changes.
Works for your test program under Linux but as the documentation says,
it is not guaranteed to have any effect at all.
Ali
On Tuesday, 7 May 2013 at 23:14:20 UTC, Ali Çehreli wrote:
On 05/07/2013 04:09 PM, Matic Kukovec wrote:> Hi
> When the program waits at "din.getc();", memory usage in the
Task
> Manager is 150MB.
>
> Why isn't the memory deallocating?
>
> P.S.;
> I tried temp_array.clear() and destroy(temp_array
On 05/07/2013 04:09 PM, Matic Kukovec wrote:> Hi
> When the program waits at "din.getc();", memory usage in the Task
> Manager is 150MB.
>
> Why isn't the memory deallocating?
>
> P.S.;
> I tried temp_array.clear() and destroy(temp_array), but nothing changed.
GC.minimize() may work.
Ali
Hi
I'm running Windows Vista 64 with dmd 2.062.
I have a simple program:
import std.stdio, core.memory, std.cstream;
void main()
{
string[] temp_array;
for(int i=0;i<500;i++)
{
++temp_array.length;
temp_array[temp_array.length - 1] =
On 2013-05-07 13:08, Dicebot wrote:
You may want to update your implementation: http://dpaste.1azy.net/640a2580
Thanks.
--
/Jacob Carlborg
You could allocate space inside a class itself with something
like this:
class Base {
int[] slice;
}
template Derived(size_t N) {
class Derived : Base {
int[N] array;
this() {
slice = array;
}
}
}
Base b = new Derived!32();
A bit pointless thoug
i'm using VisualD.
this assertion fails assert(msg == "Null reference message");
in my actual code instead of variable _message an exception is
thrown if (obj is null) == true.
i'm using the unittest block to test exception throwing.
...
this(T obj)
{
if (obj is
On Tue, 07 May 2013 10:58:09 -0400, ref2401 wrote:
Version D 2.062
class MyClass
{}
struct MyStruct(T)
if (is(T == class))
{
string _message = "nothing";
this(T obj)
{
if (obj is null){
_message = "Null reference message";
On Tuesday, 7 May 2013 at 10:33:58 UTC, Dicebot wrote:
On Tuesday, 7 May 2013 at 06:41:25 UTC, Meta wrote:
I don't really understand why either of these error messages
are occurring. The first is just incomprehensible, and the
second seems like it should work. In this case, rhs is fully
access
Version D 2.062
class MyClass
{}
struct MyStruct(T)
if (is(T == class))
{
string _message = "nothing";
this(T obj)
{
if (obj is null){
_message = "Null reference message";
}
else{
On Tue, 07 May 2013 00:03:58 +0100, Sean Kelly
wrote:
On May 2, 2013, at 6:17 AM, Regan Heath wrote:
On Wed, 01 May 2013 01:12:39 +0100, Sean Kelly
wrote:
On Apr 23, 2013, at 2:21 PM, Jack Applegame
wrote:
According WinAPI documentation, CtrlHandler will be called in new
additio
On Tuesday, 7 May 2013 at 10:29:44 UTC, Namal wrote:
Hello,
I am new to D. According to that power of 2 rule I want to
reserve 2 sized chunks to my array, But how do I do that in a
struct?
You can set some kind of statically allocated array size:
struct S
{
int[] a;
this(size_
On Tue, 07 May 2013 06:29:43 -0400, Namal wrote:
Hello,
I am new to D. According to that power of 2 rule I want to
reserve 2 sized chunks to my array, But how do I do that in a
struct? Say:
struct Stack(int){
int a[];
}
Where do I put that a.reserve(2);
Because right after the declarati
On Tuesday, 7 May 2013 at 10:58:42 UTC, John Colvin wrote:
...
int a[];
please don't use C style declarations, D style is "type followed
by id":
int[] a;
On Tuesday, 7 May 2013 at 11:03:31 UTC, Jacob Carlborg wrote:
As a workaround for "typeof" you can use this:
https://github.com/jacob-carlborg/orange/blob/master/orange/util/Traits.d#L213
You may want to update your implementation:
http://dpaste.1azy.net/640a2580
On 2013-05-07 08:41, Meta wrote:
template Test(alias N)
if (isIntegral!(typeof(N)))
{
struct S
{
typeof(N) n = N;
auto opAdd(T)(T rhs)
{
//Error: argument S to typeof is not an expression
pragma(msg, typeof(T));
//Error:
On Tuesday, 7 May 2013 at 10:29:44 UTC, Namal wrote:
Hello,
I am new to D. According to that power of 2 rule I want to
reserve 2 sized chunks to my array, But how do I do that in a
struct? Say:
struct Stack(int){
int a[];
}
"2 sized chunks"?
Perhaps you want something like this:
struct
On Tuesday, 7 May 2013 at 06:41:25 UTC, Meta wrote:
I don't really understand why either of these error messages
are occurring. The first is just incomprehensible, and the
second seems like it should work. In this case, rhs is fully
accessible at compile time in the expression (a + b), so why
Hello,
I am new to D. According to that power of 2 rule I want to
reserve 2 sized chunks to my array, But how do I do that in a
struct? Say:
struct Stack(int){
int a[];
}
Where do I put that a.reserve(2);
Because right after the declaration of a I get an error
Error: unexpected ( in decla
Sorry for my english.
On Tuesday, 7 May 2013 at 06:41:25 UTC, Meta wrote:
template Test(alias N)
if (isIntegral!(typeof(N)))
{
struct S
{
typeof(N) n = N;
auto opAdd(T)(T rhs)
{
//Error: argument S to typeof is not an expression
pragma(msg, typeof(T));
28 matches
Mail list logo