One big suspect is the object in your object[] args parameter. This looks like a boxing and unboxing issue.
When you call the WriteArgs function and pass something to it, it will perform boxing to convert that parameter to object.
Not sure what the Stream.WriteObject is or where you got that but if it takes object as parameter too and when it enter inside the WriteArgs function, it will also perform unboxing in order to use the variable that passed to it. Both boxing and unboxing allocate memory.
FIX:
Remove object[] args and create multiple overloads for your WriteArgs function that can handle different Object types as parameter.
Also, do the-same for the Stream.WriteObject if you wrote it or find alternative function for it. You can read more about boxing and unboxing here.
EDIT:
The boxing and unboxing issue described above only apply to Value Types. If you are already passing Reference Type to that function then the only problem here is the Stream.WriteObject function.