• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
NativeGCPatcher

Plugins + Scripts NativeGCPatcher

Download [<1 MB]
  Contains executable files or external scripts. Ensure you trust the creator and apply your own security measures.
Overview
Native GC Patcher is a high-performance memory management plugin for Virt-A-Mate (VaM). It interacts directly with the game's Mono runtime to control Garbage Collection (GC), eliminating micro-stutters caused by frequent GC spikes and preventing memory overflows during long sessions.

Unlike standard script-based cleaners, this plugin runs natively via BepInEx, allowing it to "Lock" the GC when memory is safe (ensuring smooth framerates) and "Force Clean" intelligently when necessary.

Key Features
Zero-Stutter Mode (GC Locking)

The plugin locks the Mono Garbage Collector to prevent it from running randomly during gameplay, which is the main cause of periodic lag spikes in VaM.
GC is only allowed to run when memory usage hits your defined limit.

Smart Auto-Triggers

On Scene Load: Automatically performs a deep clean right after a scene finishes loading.
On Person Removed: Automatically cleans up memory when you delete a character, preventing "ghost" data from clogging your RAM.
Includes "Debounce" technology: If you delete multiple characters quickly, it waits until you are done before cleaning.

Smart RAM Detection

On first launch (or hardware change), the plugin detects your total System RAM and automatically sets a safe Memory Limit (defaulting to ~50% of your total RAM).


Requirements
Virt-A-Mate (v1.20 or newer recommended)
BepInEx 5.x (x64) installed in your VaM folder.


Installation
Ensure you have BepInEx installed. (If you see a BepInEx folder in your VaM root directory, you are good to go).
Copy the NativeGCPatcher.dll file into: .../Virt-A-Mate/BepInEx/plugins/
Start the game. You should see a status overlay in the top-left corner.

Controls & Usage
f88469c3455a099b5aab95be79aff6a2.png

Ctrl + G: Toggle the Settings Window.
Overlay Status:

Active : GC is running normally (or locked safely).
Locked : GC is suppressed to ensure smooth FPS.
PAUSED : Emergency Stop. Memory usage is critically high; the plugin has disabled itself to prevent crashes.

Enable Plugin :
Turns the entire logic on/off.

Memory Limit (GB) :
If your memory is less than 16GB, the plugin will not take effect.

The Min value is set to 8GB, and the Max value is your memory capacity of -8GB.
The threshold where GC is allowed to run. If usage is below this, GC is locked for smoothness.

GC On Scene Load : Triggers a cleanup immediately after a scene loads. Highly recommended.

GC On Person Removed : Triggers a cleanup when a Person atom is destroyed.

Show Overlay : Displays the mini status info in the top-left corner.


Configuration
You can edit settings via the in-game window (Ctrl+G) or by editing the config file at:
.../Virt-A-Mate/BepInEx/config/com.yours.gcpatcher.cfg



FAQ
Q: Why does the game freeze for a second sometimes?
A: That is the "Force GC" kicking in. It freezes the game briefly to reclaim memory. This is intentional and happens only when you hit your Memory Limit or trigger an event (like loading a scene), preventing random stutters during gameplay.

Q: My Memory Limit changed automatically?
A: The plugin detected a change in your system hardware (e.g., you upgraded RAM or moved to a new PC) and auto-adjusted the limit to a safe value.
  Contains executable files or external scripts. Ensure you trust the creator and apply your own security measures.
React to this content...

Share this resource

More resources from Ashu27

Back
Top Bottom