So, I completely found all answers.
In my game of 260 Mb:
100 Mb consumes GC,
100 Mb consumes scene in glNewList.
And 30 Mb textures in glTexImage2D.
Very well, now I know what to do and how to get it smaller.
Big thanks to all.
On Thursday, April 05, 2018 22:29:54 unDEFER via Digitalmars-d wrote:
> On Thursday, 5 April 2018 at 22:06:10 UTC, Jonathan M Davis wrote:
> > You could also look at how x.capacity compares to x.length as
> > well as core.memory.GC.stats() to see what the GC thinks that
> > it's using. On my system
On Thursday, 5 April 2018 at 22:23:12 UTC, Steven Schveighoffer
wrote:
1. Compare to C malloc-ing 1.2MB at once (GC uses C malloc
underneath)
Yes after initialize malloc'ed 1.2Mb in C it consumes 1.6 Mb. 4.8
Mb => 4.9 Mb
2. Have you examined smaller numbers for total? Does it scale
linearly
On Thursday, 5 April 2018 at 22:06:10 UTC, Jonathan M Davis wrote:
You could also look at how x.capacity compares to x.length as
well as core.memory.GC.stats() to see what the GC thinks that
it's using. On my system, the x.capacity was only 9 greater
than x.length, and GC.stats printed as
Ye
On 4/5/18 5:44 PM, unDEFER wrote:
OK, without reallocation:
8<
void main()
{
float[3] f;
float[3][] x;
writefln("float = %s bytes", float.sizeof);
writefln("float[3] = %s bytes", f.sizeof);
int before = MemoryUsage();
int to
On Thursday, April 05, 2018 21:44:35 unDEFER via Digitalmars-d wrote:
> OK, without reallocation:
>
> 8<
> void main()
> {
> float[3] f;
> float[3][] x;
> writefln("float = %s bytes", float.sizeof);
> writefln("float[3] = %s bytes", f.size
On Thursday, April 05, 2018 21:27:54 unDEFER via Digitalmars-d wrote:
> On Thursday, 5 April 2018 at 21:11:53 UTC, Steven Schveighoffer
>
> wrote:
> > But the old block doesn't go away! It's collected and stored in
> > a free list for future allocations.
> >
> > -Steve
>
> Big thanks, -Steve! Reall
OK, without reallocation:
8<
void main()
{
float[3] f;
float[3][] x;
writefln("float = %s bytes", float.sizeof);
writefln("float[3] = %s bytes", f.sizeof);
int before = MemoryUsage();
int total = 100;
x = new float[3][total*100
On Thursday, 5 April 2018 at 20:58:32 UTC, unDEFER wrote:
100K * float[3] = 2356 Kbytes
Why not 1200 Kbytes?
My guess is the reallocation triggered by ~= just passed the
double threshold there.
When the runtime appends, it usually reserves (about) 2x of what
it actually needs. This is a pe
On Thursday, 5 April 2018 at 21:11:53 UTC, Steven Schveighoffer
wrote:
But the old block doesn't go away! It's collected and stored in
a free list for future allocations.
-Steve
Big thanks, -Steve! Really program like the next:
==8<==
void main()
{
float[3] f;
On 4/5/18 4:58 PM, unDEFER wrote:
It prints:
$ ./memory
float = 4 bytes
float[3] = 12 bytes
100K * float[3] = 2356 Kbytes
Why not 1200 Kbytes?
Array appending is complex.
As you append, it continually "fills in" the memory block you have. But
once it outgrows that block, it needs to allocat
Hello!
Here very simple test program:
--->8
import std.conv;
import std.stdio;
import std.string;
int MemoryUsage()
{
auto file = File("/proc/self/status");
foreach (line; file.byLine())
{
if (line[0..6] == "VmRSS:")
{
r
12 matches
Mail list logo