Memory Mapped PLs

Posted by Grant Holman on 10-Sep-2018 09:45

I've been comparing regular (non-memory mapped) PL files to memory mapped versions (on Windows 2012) and can't detect any difference in memory usage.  I ran multiple clients using first regular PLs then MM eqivalents and memory usage appeared to be the same for both.

My understanding is that MM PLs will be loaded up once only and shared between all Progress clients (as opposed to regular where PLs where each client is using its own copy).

Admittedly I'm no memory guru, so I may just not be analysing the figures shown in Task Manager correctly.

Any tips appreciated.

Posted by Matt Gilarde on 11-Sep-2018 08:57

Neither memory-mapped nor non-memory-mapped PL files instantly use up as much memory as the size of the file. The AVM doesn't read the entire non-mapped file into memory when it first accesses it. It only reads the directory (the list of files contained in the library) and then reads the r-code on demand. If you never run any procedures from the library no more memory (other than the memory allocated for the directory) will be used for the library. If you only run half of the procedures you'll only use half of the memory (or less, since the AVM has limits on how much r-code it keeps in memory at once).

For mapped libraries the story is similar. The directory is read when the file is first accessed. The operating system will reserve enough memory in the virtual address space to fit the entire file but it won't actually allocate that much memory. Memory will be allocated as the AVM reads r-code from the PL file. The advantage is that this memory is shared between processes so each one doesn't have its own copy.

I think you would have to set up a test where all of the code in the library is loaded so you can so a comparison between mapped and non-mapped.

Posted by Brian K. Maher on 11-Sep-2018 07:22

Grant,
 
Frank’s response is the answer.  Use what he said.
 
Brian Maher
Principal Engineer, Technical Support
Progress
Progress
14 Oak Park | Bedford, MA 01730 | USA
phone
+1 781 280 3075
 
 
Twitter
Facebook
LinkedIn
Google+
 

Posted by frank.meulblok on 11-Sep-2018 06:01

1. Make sure you're running code from the .pl while you're monitoring, to ensure the .pl is actually loaded.

2. Compare the different types of memory (Process Private, Shared Memory, Mapped Files etc.). Going off the top of my head: mapped pls should show as an increase in the mapped files pool, regular .pls will be in process private memory as far as they use memory - those use the r-code pool sized by -mmax, same as loose .r files.

All Replies

Posted by ChUIMonster on 10-Sep-2018 10:14

Task manager's perspective will not be adequate.  To dig into the details of memory usage you need the "sysinternals" tools.

Posted by Grant Holman on 10-Sep-2018 10:26

Thanks.  I did try Sysinternal's RAMMap tool, but again I couldn't determine and difference in memory usage.

Posted by Brian K. Maher on 10-Sep-2018 10:32

Hi Grant,
 
Tell us about the environment where you are using these pl files (# clients, client types, all on one machine?, etc).
 
Brian Maher
Principal Engineer, Technical Support
Progress
Progress
14 Oak Park | Bedford, MA 01730 | USA
phone
+1 781 280 3075
 
 
Twitter
Facebook
LinkedIn
Google+
 
 

Posted by Grant Holman on 11-Sep-2018 04:42

Hi Brian

This is 32bit Progress 91.C (base install, no Service Packs) on 64bit Windows 2012 R2 Terminal Server.  All PLs and clients running on this machine.

Where exactly in Task Manager or RAMMap should I be looking to prove MM PLs are 'working' and would give the reduced memory footprint benefit I think they should?

Posted by frank.meulblok on 11-Sep-2018 06:01

1. Make sure you're running code from the .pl while you're monitoring, to ensure the .pl is actually loaded.

2. Compare the different types of memory (Process Private, Shared Memory, Mapped Files etc.). Going off the top of my head: mapped pls should show as an increase in the mapped files pool, regular .pls will be in process private memory as far as they use memory - those use the r-code pool sized by -mmax, same as loose .r files.

Posted by Grant Holman on 11-Sep-2018 07:19

Thanks Frank.

Posted by Brian K. Maher on 11-Sep-2018 07:22

Grant,
 
Frank’s response is the answer.  Use what he said.
 
Brian Maher
Principal Engineer, Technical Support
Progress
Progress
14 Oak Park | Bedford, MA 01730 | USA
phone
+1 781 280 3075
 
 
Twitter
Facebook
LinkedIn
Google+
 

Posted by Matt Gilarde on 11-Sep-2018 08:57

Neither memory-mapped nor non-memory-mapped PL files instantly use up as much memory as the size of the file. The AVM doesn't read the entire non-mapped file into memory when it first accesses it. It only reads the directory (the list of files contained in the library) and then reads the r-code on demand. If you never run any procedures from the library no more memory (other than the memory allocated for the directory) will be used for the library. If you only run half of the procedures you'll only use half of the memory (or less, since the AVM has limits on how much r-code it keeps in memory at once).

For mapped libraries the story is similar. The directory is read when the file is first accessed. The operating system will reserve enough memory in the virtual address space to fit the entire file but it won't actually allocate that much memory. Memory will be allocated as the AVM reads r-code from the PL file. The advantage is that this memory is shared between processes so each one doesn't have its own copy.

I think you would have to set up a test where all of the code in the library is loaded so you can so a comparison between mapped and non-mapped.

Posted by Grant Holman on 12-Sep-2018 07:26

Thanks to all who replied, that's all helped explain a way forward.

This thread is closed