-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tile38 uses more and more memory #530
Comments
Tile38 stores all of its data in memory and has a garbage collector that releases unused memory over time. It will use as much memory as it needs in order to maintain the data you give it. Because it has a garbage collector, the memory will grow and then later shrink, under normal operations. If those 1000 writes per second are adding new objects to the database then you should see constant memory growth, but if you mostly updating existing then you will see growth then, at a later time, memory shrinks. A lot will depend on the type of data and the write patterns that you use. The SERVER command may be useful to you. The output provides the field |
It's exactly like you said I saw GC working but he can only recycle a small amount of memory . I try to add an expiration time to each key but memory will still increase . The command I use when writing data is Here is the Java code:
|
What is the output from the SERVER command? |
{"ok":true,"stats":{"aof_size":509837447,"avg_item_size":1250,"cpus":6,"heap_released":8798208,"heap_size":1119227344,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31163007,"max_heap_size":0,"mem_alloc":1119227344,"num_collections":328,"num_hooks":0,"num_objects":894959,"num_points":894959,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"186.958µs"} {"ok":true,"stats":{"aof_size":510213462,"avg_item_size":1254,"cpus":6,"heap_released":8798208,"heap_size":1122930016,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31172989,"max_heap_size":0,"mem_alloc":1122930016,"num_collections":329,"num_hooks":0,"num_objects":895252,"num_points":895252,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"123.173µs"} {"ok":true,"stats":{"aof_size":510648392,"avg_item_size":1257,"cpus":6,"heap_released":8798208,"heap_size":1126503632,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31184720,"max_heap_size":0,"mem_alloc":1126503632,"num_collections":329,"num_hooks":0,"num_objects":895596,"num_points":895596,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"109.944µs"} {"ok":true,"stats":{"aof_size":511060169,"avg_item_size":1260,"cpus":6,"heap_released":8798208,"heap_size":1129217264,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31195497,"max_heap_size":0,"mem_alloc":1129217264,"num_collections":329,"num_hooks":0,"num_objects":895912,"num_points":895912,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"114.244µs"} {"ok":true,"stats":{"aof_size":511434202,"avg_item_size":1263,"cpus":6,"heap_released":8798208,"heap_size":1132127672,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31205414,"max_heap_size":0,"mem_alloc":1132127672,"num_collections":329,"num_hooks":0,"num_objects":896203,"num_points":896203,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"114.241µs"} {"ok":true,"stats":{"aof_size":511807010,"avg_item_size":1265,"cpus":6,"heap_released":8798208,"heap_size":1134886912,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31215397,"max_heap_size":0,"mem_alloc":1134886912,"num_collections":329,"num_hooks":0,"num_objects":896496,"num_points":896496,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"109.117µs"} {"ok":true,"stats":{"aof_size":512181019,"avg_item_size":1268,"cpus":6,"heap_released":8798208,"heap_size":1137273216,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31225384,"max_heap_size":0,"mem_alloc":1137273216,"num_collections":330,"num_hooks":0,"num_objects":896789,"num_points":896789,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"112.861µs"} {"ok":true,"stats":{"aof_size":512571578,"avg_item_size":1270,"cpus":6,"heap_released":8798208,"heap_size":1140181024,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31235618,"max_heap_size":0,"mem_alloc":1140181024,"num_collections":333,"num_hooks":0,"num_objects":897089,"num_points":897089,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"116.396µs"} {"ok":true,"stats":{"aof_size":514358799,"avg_item_size":1288,"cpus":6,"heap_released":8798208,"heap_size":1157515040,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31283059,"max_heap_size":0,"mem_alloc":1157515040,"num_collections":334,"num_hooks":0,"num_objects":898478,"num_points":898478,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"113.54µs"} {"ok":true,"stats":{"aof_size":514672125,"avg_item_size":1290,"cpus":6,"heap_released":8798208,"heap_size":1159727184,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31291463,"max_heap_size":0,"mem_alloc":1159727184,"num_collections":336,"num_hooks":0,"num_objects":898724,"num_points":898724,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"124.748µs"} {"ok":true,"stats":{"aof_size":515074367,"avg_item_size":1293,"cpus":6,"heap_released":8798208,"heap_size":1162758376,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31302328,"max_heap_size":0,"mem_alloc":1162758376,"num_collections":336,"num_hooks":0,"num_objects":899042,"num_points":899042,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"101.905µs"} {"ok":true,"stats":{"aof_size":515425579,"avg_item_size":1296,"cpus":6,"heap_released":8798208,"heap_size":1165791656,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31311640,"max_heap_size":0,"mem_alloc":1165791656,"num_collections":334,"num_hooks":0,"num_objects":899314,"num_points":899314,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"128.243µs"} {"ok":true,"stats":{"aof_size":515903167,"avg_item_size":1299,"cpus":6,"heap_released":8798208,"heap_size":1168912528,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31324187,"max_heap_size":0,"mem_alloc":1168912528,"num_collections":333,"num_hooks":0,"num_objects":899681,"num_points":899681,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"100.88µs"} {"ok":true,"stats":{"aof_size":516277470,"avg_item_size":1302,"cpus":6,"heap_released":8798208,"heap_size":1172104544,"http_transport":true,"id":"aed26de11ffc73966679571a7a899beb","in_memory_size":31334066,"max_heap_size":0,"mem_alloc":1172104544,"num_collections":333,"num_hooks":0,"num_objects":899970,"num_points":899970,"num_strings":0,"pid":1,"pointer_size":8,"read_only":false,"threads":17,"version":"1.19.5"},"elapsed":"88.774µs"} |
now It seems to be increasing all the time |
This is normal behavior. Tile38 has a garbage collector. So every action you perform, including calling SERVER, SET, DEL, etc will increase the allocate memory a little. But at a later point in time, any unused memory will be automatically reused or freed. Your instance of Tile38 has a heap of 1,172,104,544 bytes (so about 1.1 GB) and 899,970 objects. Each object takes up a little memory, which includes the object id, the object data, any fields and properties belonging to that object, and it a little extra memory for storing it in the collection btree and spatial rtree. Your average object size is 1302 bytes. If you desire you can run |
OK, thank you very much for your support . I do smart transportation and hope Tile38 is getting better and better . |
You're welcome. I wish you the best with your transportation app. |
192.168.11.102:9851> KEYS 12PRB06T4U0
|
Interesting. I'll do some investigation and keep you posted. |
Hello, I only store data for tile38 , about 1000 writes per second, but it uses more and more memory.
Is there any way you can control the growth of memory usage ?
My memory is 32g
operating system is linux
The text was updated successfully, but these errors were encountered: