Hello,
I use B4J v9.10 with internal library KeyValueStore v2.30. When I remove particular entries or even delete all data in KVS, entries become unavailable for reading but KVS file size remains the same as before remove/delete. My app writes huge amount of statistics data and the file grows pretty quick. How can I clear old data from KVS file and reduce file size?
Here's a short non-ui test code:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
and the output:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
			
			I use B4J v9.10 with internal library KeyValueStore v2.30. When I remove particular entries or even delete all data in KVS, entries become unavailable for reading but KVS file size remains the same as before remove/delete. My app writes huge amount of statistics data and the file grows pretty quick. How can I clear old data from KVS file and reduce file size?
Here's a short non-ui test code:
			
				KVS test code:
			
		
		
		Sub Process_Globals
    Private KVS As KeyValueStore
End Sub
Sub AppStart (Args() As String)
    If File.Exists(File.DirApp, "test.kvs") Then File.Delete(File.DirApp, "test.kvs")
    KVS.Initialize(File.DirApp, "test.kvs")
    Log("Initial file size: " & File.Size(File.DirApp, "test.kvs"))
    For i = 0 To 100
        KVS.Put(i, "This is a test string")
    Next
    Log("File size after put: " & File.Size(File.DirApp, "test.kvs"))
    KVS.DeleteAll
    Log("File size after delete: " & File.Size(File.DirApp, "test.kvs"))
End Sub
	and the output:
			
				KVS test code output:
			
		
		
		Initial file size: 3072
File size after put: 8192
File size after delete: 8192