Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project are documented here. Format loosely follows [Keep a Changelog](https://keepachangelog.com/).

## [Unreleased]

### Changed
- The JVM backend's heap, previously fixed at `-Xmx14g`, is now configurable via the `AUTOPYARA_JVM_HEAP` environment variable (e.g. `AUTOPYARA_JVM_HEAP=4g`), still defaulting to `14g`. Lets `AutoPYara()` run on smaller machines.

## [0.1.2] - 2026-09-03

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion autopyara/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ def _start_jvm(cls):

print(f"[*] Initializing Backend: {jar_path}")

heap = os.getenv("AUTOPYARA_JVM_HEAP", "14g")

try:
jpype.startJVM(
jpype.getDefaultJVMPath(),
f"-Djava.class.path={jar_path}",
"-Xmx14g", # Memory limit
f"-Xmx{heap}", # Memory limit (override with AUTOPYARA_JVM_HEAP, e.g. "4g")
convertStrings=True
)
cls._jvm_started = True
Expand Down
5 changes: 4 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ cluster.resetYaraState() # clear state before reuse

The result dictionary carries `rule_string`, `k_clusters`, `strings`, `file_count`, `total_files`, `TP`, `TP_total`, `conditions_min`, `conditions_max`, `gram_size`, and `byte_candidate_count`. It is `None` when no rule satisfying the configured constraints could be built.

The JVM is started once per process, and its heap is currently fixed at 14 GB in [`interface.py`](https://github.com/Botacin-s-Lab/AutoPYaraPyPI/blob/main/autopyara/interface.py) — worth knowing if you are running on a memory-constrained machine.
The JVM is started once per process, with a heap that defaults to 14 GB; set the
`AUTOPYARA_JVM_HEAP` environment variable (e.g. `AUTOPYARA_JVM_HEAP=4g`) before
constructing `AutoPYara()` to lower it on a memory-constrained machine — see
[`interface.py`](https://github.com/Botacin-s-Lab/AutoPYaraPyPI/blob/main/autopyara/interface.py).

## How the jar gets into the Python package

Expand Down
Loading