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.
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.
|
||||
Brian Maher
|
||||
Principal Engineer, Technical Support
|
||||
Progress
|
||||
14 Oak Park | Bedford, MA 01730 | USA
|
||||
|
||||
|
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.
Task manager's perspective will not be adequate. To dig into the details of memory usage you need the "sysinternals" tools.
Thanks. I did try Sysinternal's RAMMap tool, but again I couldn't determine and difference in memory usage.
|
||||
Brian Maher
|
||||
Principal Engineer, Technical Support
|
||||
Progress
|
||||
14 Oak Park | Bedford, MA 01730 | USA
|
||||
|
||||
|
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?
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.
Thanks Frank.
|
||||
Brian Maher
|
||||
Principal Engineer, Technical Support
|
||||
Progress
|
||||
14 Oak Park | Bedford, MA 01730 | USA
|
||||
|
||||
|
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.
Thanks to all who replied, that's all helped explain a way forward.