Are assemblies inside the folder point to by -assemblies alw

Posted by jquerijero on 18-Feb-2015 14:31

We are not using the -preloadCLR parameter, but it seems like the DLLs inside the -assemblies folder are being preloaded anyways. The initial memory usage seemed to increase every time we add a new DLL to the folder point to by -assemblies. If we remove some of the assemblies, the initial memory also decreases.

Any ideas? 

All Replies

Posted by Garry Hall on 18-Feb-2015 21:48

If you are just using the AVM (no PDSOE), the files in -assemblies should not be loaded until the AVM loads the CLR (more exactly, the files in assemblies.xml, not just the files in -assemblies). Any reference to .NET when executing or compiling ABL code will cause the AVM to load the CLR.

If you just start the Procedure Editor, without running any code, do you see this behaviour? Or better still, just run a simple piece of .r code which displays a message then quits.

Posted by jquerijero on 19-Feb-2015 08:18

Does it load everything referenced by assemblies.xml at once? We have some DLLs that we don't want to load until the actual class that referenced them is used.

Posted by Brian K. Maher on 19-Feb-2015 08:21

 
Preload CLR (-preloadCLR)
Use Preload CLR (-preloadCLR) to load the .NET Common Language Runtime (CLR) and any specified assemblies into the ABL session at startup. This provides for deterministic loading of the CLR and assemblies when the application is started.
Operating system and syntax
Windows
-preloadCLR
Use with
Maximum value
Minimum value
Single-user default
Multi-user default
Client Session
If you do not specify -preloadCLR, the AVM loads the CLR the first time ABL refers to, or uses, a .NET type or object either at compile time or runtime. The individual assemblies are loaded as needed.
If you specify -preloadCLR and the client machine does not have an appropriate version of the .NET framework installed, OpenEdge raises an error and shuts down.
For more information on accessing .NET objects using the ABL, see OpenEdge Development: GUI for .NET Programming. For information on the .NET CLR, refer to the Microsoft .NET Framework documentation.
Copyright © 2014 Progress Software Corporation. All rights Reserved.
 
 
 
[collapse]
From: jquerijero [mailto:bounce-jquerijero@community.progress.com]
Sent: Thursday, February 19, 2015 9:19 AM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Are assemblies inside the folder point to by -assemblies always preloaded?
 
Reply by jquerijero

Does it load everything referenced by assemblies.xml at once? We have some DLLs that we don't want to load until the actual class that referenced them is used.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Garry Hall on 19-Feb-2015 08:27

When the AVM loads the CLR, it loads everything referenced in assemblies.xml (along with dependencies). IIRC, the supported position is that all required assemblies should be referenced in the assemblies.xml file. This might have changed, I haven't kept up with it.

Posted by jquerijero on 19-Feb-2015 08:33

So the -preloadCLR documentation is not accurate;

If you do not specify -preloadCLR, the AVM loads the CLR the first time ABL refers to, or uses, a .NET type or object either at compile time or runtime. The individual assemblies are loaded as needed.

[EDIT] Does not apply to the assemblies inside the folder -assemblies points to.

Posted by Brian K. Maher on 19-Feb-2015 08:34

The documentation I posted is accurate.
 
 
[collapse]
From: jquerijero [mailto:bounce-jquerijero@community.progress.com]
Sent: Thursday, February 19, 2015 9:31 AM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Are assemblies inside the folder point to by -assemblies always preloaded?
 
Reply by jquerijero

So the -preloadCLR documentation is not accurate;

If you do not specify -preloadCLR, the AVM loads the CLR the first time ABL refers to, or uses, a .NET type or object either at compile time or runtime. The individual assemblies are loaded as needed.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by jquerijero on 19-Feb-2015 08:36

The observed behavior of loose DLLs inside the folder -assemblies points to is in question.

Posted by Brian K. Maher on 19-Feb-2015 08:53

Joseph,

Garry and I have talked and we have a few things:

1) We are checking as to whether the documentation I referenced is correct or not.  We will get back to you on that.

2) As far as the loading of "loose" assemblies (i.e. assemblies that are in the directory pointed to by the -assemblies startup parameter but are NOT lincluded in the assemblies.xml file), a look at the source code does not show that we load those assemblies.  We walk through the assemblies.xml and load the files listed in it.  Please do a simple test by running prowin32 from a command prompt (proenv) using the -assemblies parameter only and have no loose files in the -assemblies directory then in the editor do a simple MESSAGE "HELLO" VIEW-AS ALERT-BOX then look at memory consumption via Task Manager.  Write down that number then add your loose assemblies back and run the test again (from the command line).  Report back with both numbers.

Brian

Posted by jquerijero on 19-Feb-2015 08:56

Sorry, when I said loose DLLs. Those are DLLs not installed in the GAC, but are referenced inside the assemblies.xml.

Posted by Garry Hall on 19-Feb-2015 09:24

After code review, and discussion with others, I believe that particular statement in the doc is incorrect. When the AVM loads the CLR, it will load all the assemblies referenced in assemblies.xml, regardless of whether -preloadCLR is used or not.

Posted by Brian K. Maher on 19-Feb-2015 09:26

Joseph,

Since I already have a case open for you on another issue I will open a second one and log the doc bug.

Brian

This thread is closed