[ASTERIXDB-2052][OTH] Release resources on http request rejection

- user model changes: no
- storage format changes: no
- interface changes: no

details:
- When a request is rejected, we release its resources.
- A test case was added which sends 3500+ rejected requests and
  causes the server to throw out of memory error prior to this
  fix.

Change-Id: Ia0e3f3e6e2f94a31f296b3491a07f624a4fea604
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1955
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/hyracks-fullstack/hyracks/hyracks-http/pom.xml b/hyracks-fullstack/hyracks/hyracks-http/pom.xml
index 6439adb..cb69caa 100644
--- a/hyracks-fullstack/hyracks/hyracks-http/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-http/pom.xml
@@ -27,6 +27,9 @@
   <artifactId>hyracks-http</artifactId>
   <properties>
     <root.dir>${basedir}/../..</root.dir>
+    <direct.mem>-XX:MaxDirectMemorySize</direct.mem>
+    <num.arenas>-Dio.netty.allocator.numDirectArenas</num.arenas>
+    <max.order>-Dio.netty.allocator.maxOrder</max.order>
   </properties>
   <build>
     <plugins>
@@ -34,7 +37,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>-XX:MaxDirectMemorySize=16M</argLine>
+          <argLine>${direct.mem}=16M ${num.arenas}=4 ${max.order}=7</argLine>
         </configuration>
       </plugin>
     </plugins>