For instance the following function will cause a memory leak even if ruby is running.
													
																	Ruby garbage collection force. 
									
	
		
	
																	Generational garbage collection was introduced in ruby 2 1. 
																	To preserve backward compatibility with old c extensions ruby. 
																	Moreover it only concerned with the objects created and managed by ruby. 
																	Tuning approaches lourens wrote this on feb 20th 2015 9 19 am mri maintainers have put a tremendous amount of work into this is the den a publication crafted by the friendly cubs at bear metal. 
															
													
									
	
		
	
																	You can write tons of ruby code and never give a second thought to the fact that under the covers ruby is doing a bang up job of allocating and freeing memory for your code to use. 
																	The json gem suffered from this vulnerability before ruby 2 0 0 and mr. 
																	These include a generational garbage collector introduced in ruby 2 1 incremental garbage collection in 2 2 and compaction in 2 7. 
																	This post focuses on the latest released version of cruby which is 2 7. 
															
													
									
	
		
	
																	How does garbage collection work in ruby. 
																	Ruby now garbage collects dynamically generated symbols so this vulnerability isn t an issue in the latest versions of ruby but older versions are common. 
																	Ruby s garbage collection is only concerned with ruby objects. 
																	Illustration of using write barrier to add object e to the remember set. 
															
													
									
	
		
	
																	Conversely speaking if the memory is allocated without following a certain procedure it won t be taken care of.