>>43Huh. Using massif in valgrind I just found out my implementation uses
less memory than guile and also frees it in the most efficient way.
Valgrind --tool=massif heap allocation graph for guile:
MB
3.508^ #
| #
| #
| #
| #
| :@ :::::::#
| @:@:: :@::#
| @:@:: :@::#
| 2.1MB ------- My interpreter's peak '@:@:: :@::#
| :@:@::::@::@:@:: :@::#
| ::::@:::@:@:@:: @::@:@:: :@::#
| ::: @:::@:@:@:: @::@:@:: :@::#
| :::::::::::: @:::@:@:@:: @::@:@:: :@::#
| ::: :::::::: @:::@:@:@:: @::@:@:: :@::#
| :::::::::::::::::::::: :::::::: @:::@:@:@:: @::@:@:: :@::#
| ::: :: : : ::: ::::: :::::::: @:::@:@:@:: @::@:@:: :@::#
| :::@:::::: :: : : ::: ::::: :::::::: @:::@:@:@:: @::@:@:: :@::#
| :::::@:::::: :: : : ::: ::::: :::::::: @:::@:@:@:: @::@:@:: :@::#
| :::::::@:::::: :: : : ::: ::::: :::::::: @:::@:@:@:: @::@:@:: :@::#
| :::::::@:::::: :: : : ::: ::::: :::::::: @:::@:@:@:: @::@:@:: :@::#
0 +----------------------------------------------------------------------->Mi
0 118.5
Number of snapshots: 93
Detailed snapshots: [9, 40, 44, 46, 48, 53, 63, 70, 80, 90, 92 (peak)]
Heap allocation graph for my interpreter:
MB
2.025^ ##
| @# :
| @:@# @@:::::
| ::@:@# @ : : ::::::::::
| ::@:@# @ : : ::::: :: :::::::
| ::::@:@# @ : : ::::: :: ::: :: :::::::::
| @@: ::@:@# @ : : ::::: :: ::: :: :: ::: : :::
| @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::::
| ::@ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: : :
| : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: ::::::
| ::: @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: :::::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: :::::::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::@:
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::@::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::@::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::@::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::@::
| :: : @ : ::@:@# @ : : ::::: :: ::: :: :: ::: : :::@::: :::: ::::::::@::
0 +----------------------------------------------------------------------->Gi
0 40.70
Number of snapshots: 58
Detailed snapshots: [4, 8, 10, 11 (peak), 12, 37, 54]
Mine hits the peak early on at 2MB and decreases steadily after, while guile hits the peak at the end with 3.5MB because it never frees memory (also it has a shitload of memory errors if you run it through valgrind --leak-check=full).