-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry-pick two improvements (#11020)
* [vm][loader] optimize memory usage for types * Fix OOM for string transaction arguments (#189) --------- Co-authored-by: Victor Gao <[email protected]> Co-authored-by: George Mitenkov <[email protected]>
- Loading branch information
1 parent
1a6c758
commit 903e482
Showing
12 changed files
with
274 additions
and
191 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright © Aptos Foundation | ||
|
||
use move_binary_format::CompiledModule; | ||
use move_core_types::identifier::Identifier; | ||
use move_vm_runtime::move_vm::MoveVM; | ||
use move_vm_test_utils::BlankStorage; | ||
use move_vm_types::gas::UnmeteredGasMeter; | ||
|
||
const BLOB: &[u8] = include_bytes!("module_bomb.mv"); | ||
|
||
#[test] | ||
fn test_module_bomb() { | ||
let m = CompiledModule::deserialize(BLOB).unwrap(); | ||
|
||
let mut vms = vec![]; | ||
|
||
for _i in 0..2 { | ||
let vm = MoveVM::new(vec![]).unwrap(); | ||
let storage = BlankStorage; | ||
let mut sess = vm.new_session(&storage); | ||
sess.publish_module( | ||
BLOB.to_vec(), | ||
*m.self_id().address(), | ||
&mut UnmeteredGasMeter, | ||
) | ||
.unwrap(); | ||
|
||
sess.load_function(&m.self_id(), &Identifier::new("f1").unwrap(), &[]) | ||
.unwrap(); | ||
vms.push(vm); | ||
} | ||
|
||
let stats = memory_stats::memory_stats().unwrap(); | ||
println!("Physical: {}", stats.physical_mem); | ||
println!("Virtual: {}", stats.virtual_mem); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.