SlideShare a Scribd company logo
Towards Distributed Garbage Collection for
Distributed Real-Time Java
Pablo Basanta Val and Marisol García Valls
Universidad Carlos III de Madrid (SPAIN)
www.it.uc3m.es/drequiem/
Outline (概述)
 Context & Approach
 Real-time Java status
 Motivations for having a DGC service
 Strategies for a RT-DGC service
 Turning-off the DGC service
 Defining a simple RT-DGC service
 Evaluation
 Priority inversion illustration
 Blocking time introduced in remote communications
 Leasing overhead
 Conclusions and future work
2
Context
 Next generation real-time systems
 More dynamic & complex
 One approach to address this issue is to use high-level development
languages like real-time Java
 Provide developers with libraries and potentially may reduce the development
cost of applications
 However, Java was not initially designed for real-time systems
 Many features (e.g. garbage collectors collide with real-time performance)
 Research efforts are required to harmonize real-time performance with Java
3
State of the Art in Real-time Java
 Centralized systems
 Java VM, Specifications (RTSJ), Running products (Oracle, IBM, Jamaica)
 Currently in refinement in JSR-282
 Safety critical applications
 Ongoing specifications and implementations
 Active in JSR-302
 Distributed real-time Java
 Ongoing specifications (DRTSJ), and partial implementations (based on Java’s RMI)
 Stalled in JSR-50 and relaunched in 2012
4
This work contribution
 Improves garbage collection mechanisms included in Java’s RMI with real-
time performance
 Characterization of messages
 Initial performance indicators and clues
 Evaluation of different alternatives
 Benefits for the real-time Java community
 Useful for DRTSJ and other real-time RMI implementations
 Currently they do not provide operative approaches
 Backward compatible with RTSJ (no changes required)
5
Distribution real-time Java model
 Based on the DREQUIEMI’s framework for
distributed real-time Java
 It runs directly on RTSJ
 It extends Java’s RMI (Remote Method Invocations)
with predictability
 It offers a predictable garbage collector for RMI
Predictable =
configurable priorities + scheduling
parameterization
6
API of the scheduling service
(in DREQUIEI)
package es.uc3m.it.drequiem.rtrmi.server.dgc;
import java.rmi.server.dgc.*;
public interface RTDGCInterface extends java.rmi.Remote{
public void referenced(java.rmi.server.ObjID objid)
throws java.rmi.RemoteException;
public void unreferenced(java.rmi.server.ObjID objid)
throws java.rmi.RemoteException;
}
7
Motivation for having a
distributed garbage collector
 Java requires a garbage collector
 50% of all Java methods may allocate objects
 Static allocation is not a practical solution
 A distributed garbage collector is not mandatory in real-time Java
 It is not no so necessary as a local garbage collector (remote objects may be
removed manually like in CORBA)
 However, it may be beneficial in terms of collecting unused remote objects
 RMI uses the model
 To remove unwanted remote objects
8
Memory Leaks
avoided in Sun DGC
 DGC in RMI is based on
counting algorithms
 It is not able to remove
remote object cycles (to
avoid problems)
 Acyclic structures may be
collected
 (like the one in the figure)
9
Memory Leaks
avoided in Sun DGC
(2)
 Each potential invoation
to remoteObjectLeak
creates a memory leak
 After n invocations, there
are n remote objects that
may be collected
10
Relationship between the registry and the
DGC service
 The registry holds references to remote objects !!!
11
Sun’s DGC algorithm sketched
-reference list
 Based in leasing and
reference lists
 Based on a algorithm
described by Birrell
previously
 Reference lists prevent
remote object
deallocation
Remote references avoid remote object destruction
12
Sun’s DGC algorithm sketched
-Leasing
 Leasing
 To deal with faulty
scenarios
 Basic idea to wait for an
update
 periodically
Periodical renewal associated to a remote reference
13
Strategies for a real-time DGC service
 Two approaches
 To turn off DGC
 it requires new API methods to remove remote objects
 To produce a predictable version of DGC
 Requires a clear definition of priorities, periods
(So that it may be schedulable as a real-time task)
14
Strategies for a real-time DGC service
Turning DGC off
 Remote objects may removed at the server (with
current API).
00:UnicastRemoteObject
01: static boolean
02: unexportObject
03: (Remote r, bolean force)
04: throws NoSuchObjectException;
 But it could be extended with a method to list all
objects
00: UnicastRealtimeRemoteObject
01: static Vector
02: listExportedRemoteObjects();
Server node
15
Strategies for a real-time DGC service
Turning DGC off (2)
 To allow explicit deallocation from a client
00: RealtimeRemote
01: boolean unReference(Remote r)
02: throw NoSuchObjectException;
16
Strategies for a real-time DGC service
Turning DGC off
 Remote objects may removed at the server (with
current API).
00:UnicastRemoteObject
01: static boolean
02: unexportObject
03: (Remote r, bolean force)
04: throws NoSuchObjectException;
 But it could be extended with a method to list all
objects
00: UnicastRealtimeRemoteObject
01: static Vector
02: listExportedRemoteObjects();
Server node
17
Strategies for a real-time DGC service
real-time DGC
 Based on the redefinition of:
 Reference method
 Unreference method
 Leasing mechanism
18
Strategies for a real-time DGC service
real-time DGC- reference
 Reference
 Invoked each time a remote reference abandons a node
 The priority of the transaction is the priority of the thread that carries out that action
19
Strategies for a real-time DGC service
real-time DGC- unreference
 Reference
 Invoked each time a remote
reference is invoked
 The priority of the transaction is
the priority of the thread that
carries out that action
20
Strategies for a real-time DGC service
real-time DGC- lease
 Lease
 Invoked periodically
 Modeled as periodic real-time invocation (T,D,C, Priority)
21
Strategies for a real-time DGC service
real-time DGC- decoupled mechanisms
 To avoid synchronous
reference and unreference
methods
 Able decouple cost from
remote invocations
 The reference and
unreference methods are
modelled as T,D,C
transactions
22
Performance evaluation
goals
 To build an scenario that illustrates that illustrates
performance trends of current
 To evaluate the overhead introduced by the
synchronous/asynchronous remote invocations
 To evaluate the overhead introduced by the leasing
mechanism
 Reference software
 796 Mhz machines x 1 real-time router (100 Mbits second)
23
Performance evaluation
priority inversion trends
 A scenario that shows
unbounded priority
inversion was build
 Thread in client suffers
priority inversion of al
24
Performance evaluation
priority inversion due to DGC
 The real-time garbage collector may handle the priority
properly
100
400
1600
6400
25600
100
1300
2500
3700
4900
6100
7300
8500
9700
10900
12100
WCRT(µs)
T3_WCET (µs)
RT-DGC and DGC impact on Worst Case Response Times
CLIENT (with DGC)
CLIENT (with RT-DGC)
T3 (with DGC & RT-DGC )
25
Performance evaluation
deferred vs. synchronous costs
 Defered DGC reduces response times
26
Performance evaluation
leasing trends
 Above 1 minute the cost reduces remarkably (RMI default is 5 mins)
27
Conclusions (结论)
 Distributed real-time Java applications require to deal with the garbage
collector issue (disabling the DGC)
 Illustrated empirically
 The paper provides mechanisms to reduce the cost of garbage collection in
distributed real-time Java
 Illustrated empirically
28
Ongoing work
 Extensive evaluation and formalization
 Benchmarks and formalism for the real-time DGC
 An extension to other real-time infrastructures
 Used to collect real-time SOA
29
Thank you (谢谢)
30

More Related Content

PPT
Ds objects and models
PPTX
Java RMI Presentation
PDF
Remote Method Invocation (RMI)
PPTX
Corba concepts & corba architecture
PDF
DS R16 - UNIT-3.pdf
PPT
Distributed Programming using RMI
PPT
Distributed Programming using RMI
PDF
20CS2021 Distributed Computing
Ds objects and models
Java RMI Presentation
Remote Method Invocation (RMI)
Corba concepts & corba architecture
DS R16 - UNIT-3.pdf
Distributed Programming using RMI
Distributed Programming using RMI
20CS2021 Distributed Computing

Similar to Towards a garbage collector for distributed real-time Java (20)

PDF
20CS2021-Distributed Computing module 2
PDF
18CS3040 Distributed System
PDF
18CS3040_Distributed Systems
PDF
IRJET- Performance Comparison of Real-Time Garbage Collection in the Sun ...
PDF
11 Distributrd Systems and parallel systems_Chapter 5
PDF
High level programming of embedded hard real-time devices
PDF
javarmi
PPSX
Javarmi 130925082348-phpapp01
PPSX
Java rmi
PPTX
Java RMI
PDF
DConf2015 - Using D for Development of Large Scale Primary Storage
PPTX
Distributed Middleware Reliability & Fault Tolerance Support in System S
PPTX
Java RMI
PDF
Object-Oriented Real-Time Distributed Computing, 1999. (ISORC '99)
PDF
Realtime Java Programming With Java Rts Bruno Eric J Bollella
PPTX
Communication in Distributed Systems
PPTX
PPT ON PPT ON SOFTWARE ARCHITECTURE module5
PPTX
Remote Method Invocation
PPT
Real-time Programming in Java
PPT
Introduction to Real Time Java
20CS2021-Distributed Computing module 2
18CS3040 Distributed System
18CS3040_Distributed Systems
IRJET- Performance Comparison of Real-Time Garbage Collection in the Sun ...
11 Distributrd Systems and parallel systems_Chapter 5
High level programming of embedded hard real-time devices
javarmi
Javarmi 130925082348-phpapp01
Java rmi
Java RMI
DConf2015 - Using D for Development of Large Scale Primary Storage
Distributed Middleware Reliability & Fault Tolerance Support in System S
Java RMI
Object-Oriented Real-Time Distributed Computing, 1999. (ISORC '99)
Realtime Java Programming With Java Rts Bruno Eric J Bollella
Communication in Distributed Systems
PPT ON PPT ON SOFTWARE ARCHITECTURE module5
Remote Method Invocation
Real-time Programming in Java
Introduction to Real Time Java
Ad

More from Universidad Carlos III de Madrid (13)

PPT
Tecnicas y extensiones para Java de tiempo real
PDF
A simple data muling protocol
PDF
Mejoras a la predictibilidad de la tecnología Java EE
PPTX
Remote Memory Areas for distributed real-time Java
PDF
Towards a real-time reconfiguration service for distributed Java
PPT
No Heap Remote Objects for Distributed real-time Java
PPT
A synchronous scheduling service for distributed real-time Java
PPT
Simple asynchronous remote invocations for distributed real-time Java
PPT
Pbasanta@jtres06 extendedportal
PPT
Enhancing the region model of RTSJ
PPT
Tecnicas y extensiones para Java de tiempo real
A simple data muling protocol
Mejoras a la predictibilidad de la tecnología Java EE
Remote Memory Areas for distributed real-time Java
Towards a real-time reconfiguration service for distributed Java
No Heap Remote Objects for Distributed real-time Java
A synchronous scheduling service for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time Java
Pbasanta@jtres06 extendedportal
Enhancing the region model of RTSJ
Ad

Recently uploaded (20)

PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
PPTX
2. Earth - The Living Planet earth and life
PPTX
Microbiology with diagram medical studies .pptx
PDF
. Radiology Case Scenariosssssssssssssss
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPTX
INTRODUCTION TO EVS | Concept of sustainability
PPTX
neck nodes and dissection types and lymph nodes levels
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
PPTX
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
PDF
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
PPTX
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PDF
AlphaEarth Foundations and the Satellite Embedding dataset
PDF
Biophysics 2.pdffffffffffffffffffffffffff
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PDF
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
The KM-GBF monitoring framework – status & key messages.pptx
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
Introduction to Fisheries Biotechnology_Lesson 1.pptx
2. Earth - The Living Planet earth and life
Microbiology with diagram medical studies .pptx
. Radiology Case Scenariosssssssssssssss
7. General Toxicologyfor clinical phrmacy.pptx
INTRODUCTION TO EVS | Concept of sustainability
neck nodes and dissection types and lymph nodes levels
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
TOTAL hIP ARTHROPLASTY Presentation.pptx
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
AlphaEarth Foundations and the Satellite Embedding dataset
Biophysics 2.pdffffffffffffffffffffffffff
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...

Towards a garbage collector for distributed real-time Java

  • 1. Towards Distributed Garbage Collection for Distributed Real-Time Java Pablo Basanta Val and Marisol García Valls Universidad Carlos III de Madrid (SPAIN) www.it.uc3m.es/drequiem/
  • 2. Outline (概述)  Context & Approach  Real-time Java status  Motivations for having a DGC service  Strategies for a RT-DGC service  Turning-off the DGC service  Defining a simple RT-DGC service  Evaluation  Priority inversion illustration  Blocking time introduced in remote communications  Leasing overhead  Conclusions and future work 2
  • 3. Context  Next generation real-time systems  More dynamic & complex  One approach to address this issue is to use high-level development languages like real-time Java  Provide developers with libraries and potentially may reduce the development cost of applications  However, Java was not initially designed for real-time systems  Many features (e.g. garbage collectors collide with real-time performance)  Research efforts are required to harmonize real-time performance with Java 3
  • 4. State of the Art in Real-time Java  Centralized systems  Java VM, Specifications (RTSJ), Running products (Oracle, IBM, Jamaica)  Currently in refinement in JSR-282  Safety critical applications  Ongoing specifications and implementations  Active in JSR-302  Distributed real-time Java  Ongoing specifications (DRTSJ), and partial implementations (based on Java’s RMI)  Stalled in JSR-50 and relaunched in 2012 4
  • 5. This work contribution  Improves garbage collection mechanisms included in Java’s RMI with real- time performance  Characterization of messages  Initial performance indicators and clues  Evaluation of different alternatives  Benefits for the real-time Java community  Useful for DRTSJ and other real-time RMI implementations  Currently they do not provide operative approaches  Backward compatible with RTSJ (no changes required) 5
  • 6. Distribution real-time Java model  Based on the DREQUIEMI’s framework for distributed real-time Java  It runs directly on RTSJ  It extends Java’s RMI (Remote Method Invocations) with predictability  It offers a predictable garbage collector for RMI Predictable = configurable priorities + scheduling parameterization 6
  • 7. API of the scheduling service (in DREQUIEI) package es.uc3m.it.drequiem.rtrmi.server.dgc; import java.rmi.server.dgc.*; public interface RTDGCInterface extends java.rmi.Remote{ public void referenced(java.rmi.server.ObjID objid) throws java.rmi.RemoteException; public void unreferenced(java.rmi.server.ObjID objid) throws java.rmi.RemoteException; } 7
  • 8. Motivation for having a distributed garbage collector  Java requires a garbage collector  50% of all Java methods may allocate objects  Static allocation is not a practical solution  A distributed garbage collector is not mandatory in real-time Java  It is not no so necessary as a local garbage collector (remote objects may be removed manually like in CORBA)  However, it may be beneficial in terms of collecting unused remote objects  RMI uses the model  To remove unwanted remote objects 8
  • 9. Memory Leaks avoided in Sun DGC  DGC in RMI is based on counting algorithms  It is not able to remove remote object cycles (to avoid problems)  Acyclic structures may be collected  (like the one in the figure) 9
  • 10. Memory Leaks avoided in Sun DGC (2)  Each potential invoation to remoteObjectLeak creates a memory leak  After n invocations, there are n remote objects that may be collected 10
  • 11. Relationship between the registry and the DGC service  The registry holds references to remote objects !!! 11
  • 12. Sun’s DGC algorithm sketched -reference list  Based in leasing and reference lists  Based on a algorithm described by Birrell previously  Reference lists prevent remote object deallocation Remote references avoid remote object destruction 12
  • 13. Sun’s DGC algorithm sketched -Leasing  Leasing  To deal with faulty scenarios  Basic idea to wait for an update  periodically Periodical renewal associated to a remote reference 13
  • 14. Strategies for a real-time DGC service  Two approaches  To turn off DGC  it requires new API methods to remove remote objects  To produce a predictable version of DGC  Requires a clear definition of priorities, periods (So that it may be schedulable as a real-time task) 14
  • 15. Strategies for a real-time DGC service Turning DGC off  Remote objects may removed at the server (with current API). 00:UnicastRemoteObject 01: static boolean 02: unexportObject 03: (Remote r, bolean force) 04: throws NoSuchObjectException;  But it could be extended with a method to list all objects 00: UnicastRealtimeRemoteObject 01: static Vector 02: listExportedRemoteObjects(); Server node 15
  • 16. Strategies for a real-time DGC service Turning DGC off (2)  To allow explicit deallocation from a client 00: RealtimeRemote 01: boolean unReference(Remote r) 02: throw NoSuchObjectException; 16
  • 17. Strategies for a real-time DGC service Turning DGC off  Remote objects may removed at the server (with current API). 00:UnicastRemoteObject 01: static boolean 02: unexportObject 03: (Remote r, bolean force) 04: throws NoSuchObjectException;  But it could be extended with a method to list all objects 00: UnicastRealtimeRemoteObject 01: static Vector 02: listExportedRemoteObjects(); Server node 17
  • 18. Strategies for a real-time DGC service real-time DGC  Based on the redefinition of:  Reference method  Unreference method  Leasing mechanism 18
  • 19. Strategies for a real-time DGC service real-time DGC- reference  Reference  Invoked each time a remote reference abandons a node  The priority of the transaction is the priority of the thread that carries out that action 19
  • 20. Strategies for a real-time DGC service real-time DGC- unreference  Reference  Invoked each time a remote reference is invoked  The priority of the transaction is the priority of the thread that carries out that action 20
  • 21. Strategies for a real-time DGC service real-time DGC- lease  Lease  Invoked periodically  Modeled as periodic real-time invocation (T,D,C, Priority) 21
  • 22. Strategies for a real-time DGC service real-time DGC- decoupled mechanisms  To avoid synchronous reference and unreference methods  Able decouple cost from remote invocations  The reference and unreference methods are modelled as T,D,C transactions 22
  • 23. Performance evaluation goals  To build an scenario that illustrates that illustrates performance trends of current  To evaluate the overhead introduced by the synchronous/asynchronous remote invocations  To evaluate the overhead introduced by the leasing mechanism  Reference software  796 Mhz machines x 1 real-time router (100 Mbits second) 23
  • 24. Performance evaluation priority inversion trends  A scenario that shows unbounded priority inversion was build  Thread in client suffers priority inversion of al 24
  • 25. Performance evaluation priority inversion due to DGC  The real-time garbage collector may handle the priority properly 100 400 1600 6400 25600 100 1300 2500 3700 4900 6100 7300 8500 9700 10900 12100 WCRT(µs) T3_WCET (µs) RT-DGC and DGC impact on Worst Case Response Times CLIENT (with DGC) CLIENT (with RT-DGC) T3 (with DGC & RT-DGC ) 25
  • 26. Performance evaluation deferred vs. synchronous costs  Defered DGC reduces response times 26
  • 27. Performance evaluation leasing trends  Above 1 minute the cost reduces remarkably (RMI default is 5 mins) 27
  • 28. Conclusions (结论)  Distributed real-time Java applications require to deal with the garbage collector issue (disabling the DGC)  Illustrated empirically  The paper provides mechanisms to reduce the cost of garbage collection in distributed real-time Java  Illustrated empirically 28
  • 29. Ongoing work  Extensive evaluation and formalization  Benchmarks and formalism for the real-time DGC  An extension to other real-time infrastructures  Used to collect real-time SOA 29