I have a question relates to PHP and Java programming.
I am going to develop a web application to do a unit testing.
PHP is the language that I’ll use for the web and will executes the exec() function.
as I read, the function returns the output of execution, ok I do need it.
but it’s not enough, I also think if I can get how much memory are used during the execution.
the web will run in an Apache web server in a Linux native operating system (orefered in Ubuntu).
This is the second case:
if there is a Java source which contains a program in which requires the user input during the execution, how can I execute it via a web server with also pass all the lines which may act as the user input?
the next problem is, the exec() function only accepts parameters in line.
How if I want
so, if there is any idea how to do that things?
The
/usr/bin/timeprogram (documented intime(1)) can return the amount of memory used during execution:You can see that the
echo(1)program required 2.5 megabytes of memory and ran very quickly. Larger programs will be more impressive:jacksumis a Java-based program, so it took 57 megabytes to tell me I screwed up the command line arguments. That’s more like it.You might also find the BSD process account system worthwhile. See
lastcomm(1),sa(8), anddump-acct(8)for more information.