STATIC objects and garbage collector of PASOE.

Posted by thierryk on 14-Jan-2019 16:27

Hi,

Working on a REST application and in order to retrieve PDF file from my server via HTTP (content-type application/pdf) , i've implemented a web handler. This one runs on PASOE (v11.7.3).

The web handler does the work well and the web browser is able to display pdf via the default viewer.

However, while checking the stack trace on agent sessions I saw that a lot of static HTTP related objects were loaded in memory (see the non exhaustive list at the end of the post). These objects are deleted after a while, certainely by the garbage collector and PASOE auto trim. The thing is, I'm a bit concerned about it, especially when thinking that the application will be used in a multiuser mode.

So my questions are the following

Is it safe to let PASOE handle these objects ?

If not, is there a way to properly clean the stack after the REST call ?

Thanks for your help.

ABL objects

Object-1

Class:   OpenEdge/Core/Util/MathUtil.r
ObjectId:   STATIC


Object-2

Class:   OpenEdge/Core/ByteBucket.r
ObjectId:   STATIC


Object-3

Class:   OpenEdge/Net/HTTP/Filter/Writer/BodyWriterRegistry.r
ObjectId:   STATIC


Object-4

Class:   OpenEdge/Net/HTTP/Filter/Writer/MessageWriterBuilder.r
ObjectId:   STATIC


Object-5

Class:   OpenEdge/Net/HTTP/Filter/Writer/BodyWriterBuilder.r
ObjectId:   STATIC


Object-6

Class:   OpenEdge/Core/Memptr.r
ObjectId:   STATIC


Object-7

Class:   OpenEdge/Core/String.r
ObjectId:   STATIC


Object-8

Class:   OpenEdge/Net/HTTP/Filter/Writer/SetHeaderMessageWriterBuilder.r
ObjectId:   STATIC


Object-9

Class:   OpenEdge/Net/HTTP/HttpHeaderBuilder.r
ObjectId:   STATIC


Object-10

Class:   OpenEdge/Net/HTTP/HttpHeader.r
ObjectId:   STATIC


Object-11

Class:   OpenEdge/Net/HTTP/StatusCodeHelper.r
ObjectId:   STATIC


Object-12

Class:   OpenEdge/Net/HTTP/HttpHeaderCollection.r
ObjectId:   STATIC


Object-13

Class:   Ccs/Common/Application.r
ObjectId:   STATIC


Object-14

Class:   OpenEdge/Core/Util/TokenResolver.r
ObjectId:   STATIC


Object-15

Class:   OpenEdge/Logging/TokenResolver.r
ObjectId:   STATIC


Posted by Peter Judge on 14-Jan-2019 17:30

The various ‘registry’ objects you see are infrastructure for the http client and web handlers. They act as caches of name/value pairs of plugins that are used in the ABL components we (PSC) provide. They are loaded once only, on first call, and will persist for the life of the session.

 

 

 

However, while checking the stack trace on agent sessions I saw that a lot of static HTTP related objects were loaded in memory (see the non exhaustive list at the end of the post). These objects are deleted after a while, certainely by the garbage collector and PASOE auto trim. The thing is, I'm a bit concerned about it, especially when thinking that the application will be used in a multiuser mode.

So my questions are the following

Is it safe to let PASOE handle these objects ?

If not, is there a way to properly clean the stack after the REST call ?

 
 
Posted by frank.meulblok on 14-Jan-2019 16:43

STATIC classes (or rather, the STATIC members of a class type) are loaded into memory only once, and stay there for the lifetime of the process.

The garbage collector won't touch them, that only handles object instances. Statics apply to the class type.

The main side effects of the implementation are that:

a) You need to restart the process for changes to static members to take effect. This is mostly a pain during development, there's steps you can take in production to minimize downtime.

b) If you have a lot of static members, your minimum memory requirements may increase.

All Replies

Posted by frank.meulblok on 14-Jan-2019 16:43

STATIC classes (or rather, the STATIC members of a class type) are loaded into memory only once, and stay there for the lifetime of the process.

The garbage collector won't touch them, that only handles object instances. Statics apply to the class type.

The main side effects of the implementation are that:

a) You need to restart the process for changes to static members to take effect. This is mostly a pain during development, there's steps you can take in production to minimize downtime.

b) If you have a lot of static members, your minimum memory requirements may increase.

Posted by Peter Judge on 14-Jan-2019 17:30

The various ‘registry’ objects you see are infrastructure for the http client and web handlers. They act as caches of name/value pairs of plugins that are used in the ABL components we (PSC) provide. They are loaded once only, on first call, and will persist for the life of the session.

 

 

 

However, while checking the stack trace on agent sessions I saw that a lot of static HTTP related objects were loaded in memory (see the non exhaustive list at the end of the post). These objects are deleted after a while, certainely by the garbage collector and PASOE auto trim. The thing is, I'm a bit concerned about it, especially when thinking that the application will be used in a multiuser mode.

So my questions are the following

Is it safe to let PASOE handle these objects ?

If not, is there a way to properly clean the stack after the REST call ?

 
 
Posted by thierryk on 01-Feb-2019 10:27

Thank you Frank and Peter.

I assume it is not an issue then.

This thread is closed