Now look
OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
244.344mS OK
MARK-TIME HERE 8,000,000,000 ERASE ELAPSED .mS
67782.522mS OK
Apparently zeroing a gigabyte takes approximately a quarter of a second.
8 Gigabyte would take 2 seconds. Although the whole program fits
comfortably in RAM, it takes 30 times longer.
What gives?
8 Gigabyte would take 2 seconds. Although the whole program fits
comfortably in RAM, it takes 30 times longer.
What gives?
I don't know (yet) how it works in Linux, but in Windows there
is something called 'Working-Set'. If I exceed that value,
things slow down.
It is quite difficult (if not impossible) to increase the
Working-Set without extensive knowledge (believe me, I tried).
On Mon, 23 Sep 2024 17:51:58 +0000, mhx wrote:
I don't know (yet) how it works in Linux, but in Windows there
is something called 'Working-Set'. If I exceed that value,
things slow down.
It is quite difficult (if not impossible) to increase the
Working-Set without extensive knowledge (believe me, I tried).
Have you tried the SetProcessWorkingSetSize function
(memoryapi.h)?
It sets the minimum and maximum working set sizes for the
specified process, they say...
On Mon, 23 Sep 2024 18:19:44 +0000, minforth wrote:
Have you tried the SetProcessWorkingSetSize function
(memoryapi.h)?
It sets the minimum and maximum working set sizes for the
specified process, they say...
Yes, but...
Main memory (DRAM of some type) is the new hard disk.
The difference in speed between cache and main memory looks a lot like
the difference between main memory and hard disk did a few decades ago.
So if you thrash the backing store, operation will slow down.
Potentially complicating things are an OS. Is this Forth running bare
metal on the AMD with no OS? If there is an OS then all sorts of memory >management issues appear.
If you need more memory space than you have physical memory, it will
seem as if your backing store is a tape drive. :-)
--
http://davesrocketworks.com
David Schultz
albert@spenarnc.xs4all.nl writes:
Now look
OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
244.344mS OK
MARK-TIME HERE 8,000,000,000 ERASE ELAPSED .mS
67782.522mS OK
Apparently zeroing a gigabyte takes approximately a quarter of a second.
8 Gigabyte would take 2 seconds. Although the whole program fits >>comfortably in RAM, it takes 30 times longer.
What gives?
You obviously have other stuff in more than 8GB of RAM, and paging
enough of that out to accomodate your Forth process takes its time (or
it could also swap out parts of the memory of the Forth system).
That's why I consider swapping pretty useless these days. If RAM is
too small for your needs, buy more RAM.
A
- anton
I remember running a program intended for a pdp 11 for a vax.<SNIP>
You obviously have other stuff in more than 8GB of RAM, and paging
enough of that out to accomodate your Forth process takes its time (or
it could also swap out parts of the memory of the Forth system).
In article <nnd$0b021237$626a8881@55133cc8c31c4c51>,
<albert@spenarnc.xs4all.nl> wrote:
I remember running a program intended for a pdp 11 for a vax.<SNIP>
I confused the issue with talking too much.
I run on a AMD FX870 with 16 Gbyte RAM
I run as root, and killed the gimp prime search and firefox browser.
I also give absolute priority to Forth (nice negative).
root@cherry:/home/albert/PROJECT/ciforths/ciforth# nice -20 lina16G++
AMDX86 ciforth beta 2022Feb17
WANT ELAPSED
ASSEMBLERi86-HIGH : (WARNING) NOT PRESENT, THOUGH WANTED
OK
MARK-TIME HERE 16,000,000,000 ERASE ELAPSED .mS
12810.175mS OK
MARK-TIME HERE 16,000,000,000 ERASE ELAPSED .mS
394536.356mS OK
BYE
The second time it takes 30 times longer!
Theories about working set doesn't cut it.
Also the system freezes, I expect better from a system with 8 cores,
but maybe this is caused by nice.
The following result up to 8 Gbyte are more sensible,
up to 8 Gbyte the second time is faster.
root@cherry:/home/albert/PROJECT/ciforths/ciforth# nice -20 lina16G++
WANT ELAPSED
....
OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
537.777mS OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
253.468mS OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
257.628mS OK
MARK-TIME HERE 2,000,000,000 ERASE ELAPSED .mS
781.149mS OK
MARK-TIME HERE 2,000,000,000 ERASE ELAPSED .mS
503.593mS OK
MARK-TIME HERE 4,000,000,000 ERASE ELAPSED .mS
1916.234mS OK
MARK-TIME HERE 4,000,000,000 ERASE ELAPSED .mS
1554.072mS OK
MARK-TIME HERE 8,000,000,000 ERASE ELAPSED .mS
8059.426mS OK
MARK-TIME HERE 8,000,000,000 ERASE ELAPSED .mS
5519.860mS OK
On Tue, 24 Sep 2024 12:20:42 +0000, albert@spenarnc.xs4all.nl wrote:
[..]
The following result up to 8 Gbyte are more sensible,
up to 8 Gbyte the second time is faster.
root@cherry:/home/albert/PROJECT/ciforths/ciforth# nice -20 lina16G++
WANT ELAPSED
....
OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
537.777mS OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
253.468mS OK
MARK-TIME HERE 1,000,000,000 ERASE ELAPSED .mS
257.628mS OK
MARK-TIME HERE 2,000,000,000 ERASE ELAPSED .mS
781.149mS OK
MARK-TIME HERE 2,000,000,000 ERASE ELAPSED .mS
503.593mS OK
MARK-TIME HERE 4,000,000,000 ERASE ELAPSED .mS
1916.234mS OK
MARK-TIME HERE 4,000,000,000 ERASE ELAPSED .mS
1554.072mS OK
MARK-TIME HERE 8,000,000,000 ERASE ELAPSED .mS
8059.426mS OK
MARK-TIME HERE 8,000,000,000 ERASE ELAPSED .mS
5519.860mS OK
This is exactly the problem that I encountered on
Windows: allocating GBytes of memory is a lot faster
the second time you do it, which points to an OS
memory-management feature. For me it happened when
the allocated memory size was reaching 1GB on a 32GB
system with 20GB still free, so your Linux numbers are
actually quite good.
I hoped to improve matters with the Working-Set
size (which is explicitly shown on Windows 11's
Task manager) but was not successful at the time
(will look again).
-marcel--
On Mon, 30 Sep 2024 9:53:32 +0000, albert@spenarnc.xs4all.nl wrote:[..]
FORTH> .TICKER-INFO
AMD Ryzen 7 5800X 8-Core Processor, timer & PROCESSOR-CLOCK of 4192MHz
Peak WorkingSetSize = 12075 kB
Current WorkingSetSize = 631 kB
Total memory size = 31 GB
Available memory size = 16 GB
The WorkingSetSize reflects the program's size + allocated memory.
AFAIR, this was a lot worse a few years ago.
Mysteriously, available memory size is still 16 GB.
In article <KRudnVPYhcFA8Wz7nZ2dnZfqn_SdnZ2d@earthlink.com>,
David Schultz <david.schultz@earthlink.net> wrote:
Main memory (DRAM of some type) is the new hard disk.
The difference in speed between cache and main memory looks a lot like
the difference between main memory and hard disk did a few decades ago.
So if you thrash the backing store, operation will slow down.
Potentially complicating things are an OS. Is this Forth running bare
metal on the AMD with no OS? If there is an OS then all sorts of memory >>management issues appear.
If you need more memory space than you have physical memory, it will
seem as if your backing store is a tape drive. :-)
Everybody knows that, including myself.
Haven't you read the original post?
I'm not using half of the ram present.
In article <KRudnVPYhcFA8Wz7nZ2dnZfqn_SdnZ2d@earthlink.com>,
David Schultz <david.schultz@earthlink.net> wrote:
Main memory (DRAM of some type) is the new hard disk.
The difference in speed between cache and main memory looks a lot like >>>the difference between main memory and hard disk did a few decades ago. >>>So if you thrash the backing store, operation will slow down.
Potentially complicating things are an OS. Is this Forth running bare >>>metal on the AMD with no OS? If there is an OS then all sorts of memory >>>management issues appear.
If you need more memory space than you have physical memory, it will
seem as if your backing store is a tape drive. :-)
Everybody knows that, including myself.
Haven't you read the original post?
I'm not using half of the ram present.
You still don't know what kind of memory management strategy your OS is >using.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:32:55 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,093 |