SwiftUI Tabview - how to "kill" the views we do not use

I have the MainView as the active view if the user is logged in(authenticated). the memory allocations when we run profile is pretty good. We have graphql fetching, we have token handling eg: This is All heap:

1 All Heap & Anonymous VM 13,90 MiB 65408 308557 99,10 MiB 373965 Ratio: %0.14, %0.86

After what i have checked this is pretty good for initialise and using multiple repositories eg. But when we change tabs:

1 All Heap & Anonymous VM 24,60 MiB 124651 543832 156,17 MiB 668483 Ratio: %0.07, %0.40

And that is not pretty good. So i guess we need to "kill" it or something. How? I have tried some techniques in a forum this was a recommended way:

      
       public struct LazyView<Content: View>: View {
           private let build: () -> Content
           @State private var isVisible = false
      
           public init(_ build: @escaping () -> Content) {
               self.build = build
           }
      
           public var body: some View {
               build()
               Group {
                   if isVisible {
                       build()
                   } else {
                       Color.clear
                   }
               }
               .onAppear { isVisible = true }
               .onDisappear { isVisible = false }
           }
       }

But this did not help at all. So under here is the one i use now. So pleace guide me for making this work.

import DIKit
import CoreKit
import PresentationKit
import DomainKit
public struct MainView: View {
    @Injected((any MainViewModelProtocol).self) private var viewModel

    private var selectedTabBinding: Binding<MainTab> {
        Binding(
            get: { viewModel.selectedTab },
            set: { viewModel.selectTab($0) }
        )
    }
    public init() {
        // No additional setup needed
    }
   public var body: some View {
        NavigationStack(path: Binding(
            get: { viewModel.navigationPath },
            set: { _ in  }
        )) {
            TabView(selection: selectedTabBinding) {
                LazyView {
                    FeedTabView()
                }
                .tabItem {
                    Label("Feed", systemImage: "house")
                }
                .tag(MainTab.feed)
                
                LazyView {
                    ChatTabView()
                }
                .tabItem {
                    Label("Chat", systemImage: "message")
                }
                .tag(MainTab.chat)
                
                LazyView {
                    JobsTabView()
                }
                .tabItem {
                    Label("Jobs", systemImage: "briefcase")
                }
                .tag(MainTab.jobs)
                
                LazyView {
                    ProfileTabView()
                }
                .tabItem {
                    Label("Profile", systemImage: "person")
                }
                .tag(MainTab.profile)
            }
            .accentColor(.primary)
            .navigationDestination(for: MainNavigationDestination.self) { destination in
                switch destination {
                case .profile(let userId):
                    Text("Profile for \(userId)")
                case .settings:
                    Text("Settings")
                case .jobDetails(let id):
                    Text("Job details for \(id)")
                case .chatThread(let id):
                    Text("Chat thread \(id)")
                }
            }
        }
    }
}
import SwiftUI

public struct LazyView<Content: View>: View {
    private let build: () -> Content
    
    public init(_ build: @escaping () -> Content) {
        self.build = build
    }
    
    public var body: some View {
        build()
    }
}
SwiftUI Tabview - how to "kill" the views we do not use
 
 
Q