Skip to content

Commit 12a5e3f

Browse files
committed
Small Tweaks
This is supposed to help with the overhead. From my tests, while it initially shows more overhead than the source executable, once the application is in use, both have nearly identical RAM usage.
1 parent 119beb0 commit 12a5e3f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

Source/AppMethod.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var gStream = new %mode%;
1212
byte[] tAppBytes = new byte[appSize];
1313

1414
gStream.Read(tAppBytes, 0, appSize);
15-
15+
memStr.Close();
1616
gStream.Close();
1717

1818
//End Loading App

Source/AppMethodEnd.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11

22
//nothing passed on yet.
33

4+
var assemb = Assembly.Load(tAppBytes);
5+
tAppBytes = null;
6+
GC.Collect();
7+
48
try {
5-
Assembly.Load(tAppBytes).EntryPoint.Invoke(null, new object[] { args });
9+
assemb.EntryPoint.Invoke(null, new object[] { args });
10+
611
} catch(Exception ex)
712
{
8-
Assembly.Load(tAppBytes).EntryPoint.Invoke(null, new object[] {});
13+
14+
assemb.EntryPoint.Invoke(null, new object[] {});
915
}
10-
11-
tAppBytes = null;

0 commit comments

Comments
 (0)