2 переменных это стандартная практика
class Program
{
static void Main(string[] args)
{
var mem = new List<byte[]>();
runTest(mem);
}
public static void runTest(List<byte[]> mem )
{
try
{
while (true)
{
try
{
if(mem.Count % 1024 == 0)
{
sizelog(mem.Count);
}
mem.Add(new byte[1024*1024]);
}
catch (OutOfMemoryException)
{
sizelog(mem.Count);
}
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
}
public static void sizelog(int mb)
{
try
{
using(StreamWriter writer = new StreamWriter("Log.txt", true, System.Text.Encoding.Default))
{
writer.WriteLine($"Used Mb = {mb}, GB = {mb/1024}");
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
<inpyt type='hidden' name='tags' :value='getTags()'
<input type="submit"
<button v-on:click="tags.push(newTag)">+</button>
function() { [native code] }