about Grinder MultiThreads

Gang Yan <[email protected]>
Newsgroups gmane.comp.java.grinder.user,gmane.comp.java.grinder.devel
Message-ID <779cfd73-f47e-49a3-97db-b6b0d7b52eee@default>
Hi  All

 

Sorry, I have queation about Grinder MultiThreads.

 

I write WriteMulitpleLittleFile Method test Java IO. I use Grinder Control test case run.

 

Appear Stack Overflow when start test. I set javatest.durationMinutes = 10 and grinder.threads = 1 in properties file.

 

I'm not sure this problem. I don’t know how to Control Grinder test threads in test code?

 

Please you help check.!

 

Thanks!

 

Grinder info 

 

2013-11-17 10:54:49,702 INFO  com-0 : The Grinder version 3.11

2013-11-17 10:54:49,730 INFO  com-0 : Java(TM) SE Runtime Environment 1.6.0_37-b06: Oracle JRockit(R) (R28.2.5-20-152429-1.6.0_37-20120927-1915-linux-x86_64, compiled mode) on Linux amd64 2.6.39-40

0.209.1.el6uek.x86_64

2013-11-17 10:54:49,978 INFO  com-0 : time zone is UTC (+0000)

2013-11-17 10:54:50,084 INFO  com-0 : worker process 0

2013-11-17 10:54:50,166 INFO  com-0 : instrumentation agents: byte code transforming instrumenter for Jython 2.5; byte code transforming instrumenter for Java

2013-11-17 10:54:52,449 INFO  com-0 : run mode is continuous, duration is 0:10:00

2013-11-17 10:54:52,450 INFO  com-0 : running "test_IO.py" using Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35)

[Oracle JRockit(R) (Oracle Corporation)]

2013-11-17 10:54:52,501 INFO  com-0 thread-0: starting, will do 1 run

2013-11-17 10:54:52,504 INFO  com-0 : start time is 1384685692504 ms since Epoch

2013-11-17 10:55:15,357 ERROR com-0 thread-0 [ run-0 ]: aborted run - Java exception calling TestRunner

net.grinder.scriptengine.jython.JythonScriptExecutionException: Java exception calling TestRunner

        WriteMulitpleLittleFile.write()

        File "./test_IO.py", line 62, in __call__

java.lang.OutOfMemoryError: Resource temporarily unavailable in tsStartJavaThread (lifecycle.c:1097).

 

Attempting to allocate 512M bytes

 

There is insufficient native memory for the Java

Runtime Environment to continue.

 

Possible reasons:

  The system is out of physical RAM or swap space

  In 32 bit mode, the process size limit was hit

 

Possible solutions:

  Reduce memory load on the system

  Increase physical memory or swap space

  Check if swap backing store is full

  Use 64 bit Java on a 64 bit OS

  Decrease Java heap size (-Xmx/-Xms)

  Decrease number of Java threads

  Decrease Java thread stack sizes (-Xss)

  Disable compressed references (-XXcompressedRefs=false)

 

        at java.lang.Thread.start0(Native Method) [na:1.6.0_37]

        at java.lang.Thread.start(Thread.java:640) [na:1.6.0_37]

        at javatest.WriteMulitpleLittleFile.write(WriteMulitpleLittleFile.java:66) ~[JavaOsTesting/:na]

        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) ~[na:na]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_37]

        at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_37]

        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyObject.__call__(PyObject.java:371) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyObject.__call__(PyObject.java:375) ~[jython-standalone-2.5.3.jar:na]

        at org.python.pycode._pyx1.__call__$2(./test_IO.py:61) ~[na:na]

        at org.python.pycode._pyx1.call_function(./test_IO.py) ~[na:na]

        at org.python.core.PyTableCode.call(PyTableCode.java:165) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyBaseCode.call(PyBaseCode.java:301) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyBaseCode.call(PyBaseCode.java:194) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyFunction.__call__(PyFunction.java:387) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyMethod.__call__(PyMethod.java:211) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyMethod.__call__(PyMethod.java:206) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyObject.invoke(PyObject.java:3555) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyInstance.instance___call__(PyInstance.java:351) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyInstance.__call__(PyInstance.java:342) ~[jython-standalone-2.5.3.jar:na]

        at org.python.core.PyObject.__call__(PyObject.java:371) ~[jython-standalone-2.5.3.jar:na]

        at net.grinder.scriptengine.jython.JythonScriptEngine$JythonWorkerRunnable.run(JythonScriptEngine.java:263) ~[grinder-core-3.11.jar:na]

        at net.grinder.engine.process.GrinderThread.run(GrinderThread.java:119) ~[grinder-core-3.11.jar:na]

        at java.lang.Thread.run(Thread.java:662) [na:1.6.0_37]

2013-11-17 10:55:15,360 INFO  com-0 thread-0: finished 1 run

2013-11-17 10:55:15,362 INFO  com-0 : elapsed time is 22858 ms

2013-11-17 10:55:15,362 INFO  com-0 : Final statistics for this process:

2013-11-17 10:55:15,381 INFO  com-0 :

             Tests        Errors       Mean Test    Test Time    TPS

                                       Time (ms)    Standard

                                                    Deviation

                                                    (ms)

 

Test 1       84           1            260.90       314.80       3.67          "Compress file javasrc.tar"

 

Totals       84           1            260.90       314.80       3.67

 

  Tests resulting in error only contribute to the Errors column.

  Statistics for individual tests can be found in the data file, including

  (possibly incomplete) statistics for erroneous tests. Composite tests

  are marked with () and not included in the totals.

 

 

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk

_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use
WriteMulitpleLittleFile.java (application/octet-stream, 10.6 KB) - not displayed
test_IO.properties (application/octet-stream, 2.7 KB) - not displayed
test_IO.py (application/octet-stream, 2.2 KB)
# The sorting test supports a configurable array length.
# It runs the JavaTest.sort method of the JavaTest class.

from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from datetime import datetime
from datetime import timedelta
# from javatest import JavaTest
from javatest import WriteMulitpleLittleFile

########################################
#
# main body of test script starts here
#
########################################

# Get the propeties to access test configuration information
properties = grinder.getProperties()

# The description is a property (instead of a hardcoded string in this script)
test = Test(1, properties.get("javatest.description"))

# select the method for which to collect information
test.record(WriteMulitpleLittleFile.write)

# initialize data for compressing
#fileName = properties.get("javatest.fileToCompress")
#grinder.logger.info("data file to compress is " + fileName)
#JavaTest.initializeCompression(fileName)

# If the run mode is runOnce, the TestRunner class will
# run once.  Otherwise, if the run mode is continuous,
# the TestRunner class will run the test for at least
# the specified duration (but possibly longer)
runMode = properties.get("javatest.runMode")
#WriteMulitpleLittleFile.setParameters(dir, fileSize...)
if runMode == "continuous":
  # figure out how long to run the test
  m = int(properties.getProperty("javatest.durationMinutes", "0"))
  h = int(properties.getProperty("javatest.durationHours", "0"))
  d = int(properties.getProperty("javatest.durationDays", "0"))
  duration = timedelta(minutes=m,hours=h,days=d)
  grinder.logger.info("run mode is continuous, duration is " + str(duration))
elif runMode == "runOnce":
  grinder.logger.info("run mode is run once")
  duration = timedelta(minutes=0)
else:
  grinder.logger.info("run mode not set or not recongized, default to run once")
  duration = timedelta(minutes=0)

########################################
#
# The TestRunner class is used by The Grinder to perform the test
#
########################################

class TestRunner:
  def __call__(self):
    endTime = datetime.now() + duration
    notDone = True
    while notDone:
      WriteMulitpleLittleFile.write()
      notDone = datetime.now() < endTime
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.