Verbose Garbage Collection to determine the size of the heap
I want to configure weblogic server. In the article of http://download.oracle.com/docs/cd/E14571_01/web.1111/e13814/jvm_tuning.htm#i1131863I find the following scripts. Where should I add the following command?
============================================================================
% java-ms32m-mx200m - verbosegc - classpath $CLASSPATH
-Dweblogic.name=%server_name%-Dbea.home="C:\Oracle\Middleware".
-Dweblogic.Management.username=%WLS_USER%
-Dweblogic.Management.password=%WLS_PW%
-Dweblogic.Management.Server=%ADMIN_URL%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Djava.Security.policy="%WL_HOME%\server\lib\weblogic.policy"weblogic. Server > > FichierJournal.txt 2 > & 1
Hey YOU,.
Everything what is written below is actually a single line... There is no new line in there:
JAVA_HOME\bin\java.exe-ms1024m-mx1024m-Xverbosegc:file=C:/MyGCLogDir/GC.log - classpath $CLASSPATH-Dweblogic.Name=%SERVER_NAME%-Dbea.home="C:\Oracle\Middleware"-Dweblogic.management.username=%WLS_USER%-Dweblogic.management.password=%WLS_PW%-Dweblogic.management.server=%ADMIN_URL%-Dweblogic. " ProductionModeEnabled=%STARTMODE%-Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy"weblogic. Server > FichierJournal.txt
Above is a single line... .no line break... Make sure that each JAVA_OPTION is separated by a single space. Please leave these spaces as it is... Just remove the triggered the line of your Script
If you use Notepad... .so please open "startServers.cmd" in Notepad, then (MENU Edition)---> WordWrap (disable)
.
.
Thank you
Jay SenSharma
Tags: Fusion Middleware
Similar Questions
-
Does garbage collection occurs in the region of PERM of Java Heap?
Hi guys,.
I am a new Member to this forum, my name is Javin Paul and I'm a Java programmer. I have a question related to the garbage collection in Java
Does garbage collection occurs in the region of PERM of Java Heap?
According to my knowledge PERM area is used to store metadata about classes, methods, variable etc also string Pool created in PERM area of the heap, so I believe that garbage do not occur in this place, but I just wanted to know what you guys think of it?
Thank you
HervéBasics segment of memory and so on that you are used to, do not apply the FMV of Blackberry - well they probably not, but it is well hidden from us. I recommend you check out this video to understand what you can control re garbage collection operation.
-
Turn on Weblogic Garbage Collection HP - UX Itanium
Hallo! I'm totally new to WebLogic. I was sent 11 Flexcube Universal Banking on Weblogic 10.3.2 accessing a server Oracle 11 GR 2 on HP - UX Itanium platform. Furthermore, I use Sun's JAVA virtual machine
However, the deployment of Flexcube is extremely slow, crashes and the server frequently managed overloads. I hope that by implementing the garbage collection, I can solve these problems.
Please provide me with the syntax to implement garbage collection operation in the architecture described above weblogic. All other boards of adjustment will be welcome. My setDomainEnv.sh script is as below
Thank you.
! / bin/sh
# CAUTION: This file is created by the Configuration Wizard.
# Any changes made to this script may be lost when adding extensions to this configuration.
#---Fonctions start-
BP = 100
SP = $BP
pushd()
{
If [-z "$1"]
then
return
FI
SP = 'expr $SP - 1'.
EVAL _stack$ SP = 'pwd '.
CD $1
return
}
popd()
{
If [$SP - eq $BP]
then
return
FI
EVAL cd \${_stack$SP}
SP = 'expr $SP + 1'.
return
}
#---Fonctions-
# *************************************************************************
# This script is used to set up the environment needed to be able to start Weblogic Server in this field.
#
# This script Initializes the following variables before calling commEnv to set the other variables:
#
# WL_HOME - the WebLogic of BEA installation directory.
# JAVA_VM - the Java VM you want to use. You can set this environment variable before calling
# This script from a Sun, or BEA, or everything just have the default set.
# JAVA_HOME - location of the version of Java used to start WebLogic
# Server. Depends directly on what JAVA_VM has the value default or the environment.
# USER_MEM_ARGS - the variable to override the standard memory arguments
# passed to java.
# PRODUCTION_MODE - the variable that determines if Weblogic Server is started in production mode.
# DOMAIN_PRODUCTION_MODE
# - The variable that determines if the workshop related settings such as the debugger,
# testconsole or iterativedev must be enabled. Can ONLY be set using the
command line parameter # named production
# NOTE: Specify the command line of production parameter will force
# the server starts in production mode.
#
# Other variables used in this text include:
# Servername - name of the weblogic server.
# JAVA_OPTIONS - Java command line options for the server. (These
# will be marked at the end of the JAVA_VM and
(# MEM_ARGS)
#
# For more information, see "Managing Server Startup and Shutdown for Oracle WebLogic Server"
# (http://download.oracle.com/docs/cd/E12839_01/web.1111/e13708/overview.htm).
# *************************************************************************
WL_HOME="/Oracle/middleware/wlserver_10.3".
export WL_HOME
BEA_JAVA_HOME =""
export BEA_JAVA_HOME
SUN_JAVA_HOME =""
export SUN_JAVA_HOME
If ["${JAVA_VENDOR}" = "Oracle"]; then
JAVA_HOME = "${BEA_JAVA_HOME}".
Export JAVA_HOME
on the other
If ["${JAVA_VENDOR}" = "Sun"]; then
JAVA_HOME = "${SUN_JAVA_HOME}".
Export JAVA_HOME
on the other
JAVA_VENDOR = "HP".
export JAVA_VENDOR
JAVA_HOME = "/ opt/java6.
Export JAVA_HOME
FI
FI
# It must reset the value of JAVA_HOME to get AND shortened
# We do not shorten above because immediate variable expansion will be erase
JAVA_HOME = "${JAVA_HOME}.
Export JAVA_HOME
SAMPLES_HOME = "${WL_HOME}" / samples ""
export SAMPLES_HOME
DOMAIN_HOME = ' / oracle/middleware/user_projects/domains/base_domain ".
export DOMAIN_HOME
LONG_DOMAIN_HOME = ' / oracle/middleware/user_projects/domains/base_domain ".
export LONG_DOMAIN_HOME
If ["${DEBUG_PORT}" = ""]; then
DEBUG_PORT = "8453.
export DEBUG_PORT
FI
If ["${server_name}" = ""]; then
Server_name = 'AdminServer.
Export SERVER_NAME
FI
POINTBASE_FLAG = "false".
export POINTBASE_FLAG
enableHotswapFlag =""
export enableHotswapFlag
PRODUCTION_MODE = 'true '.
export PRODUCTION_MODE
doExitFlag = "false".
export doExitFlag
verboseLoggingFlag = "false".
export verboseLoggingFlag
While [$#-gt 0]
do
case $1 in
/nodebug)
debugFlag = "false".
export debugFlag
;;
production)
DOMAIN_PRODUCTION_MODE = 'true '.
export DOMAIN_PRODUCTION_MODE
;;
notestconsole)
testConsoleFlag = "false".
export testConsoleFlag
;;
noiterativedev)
iterativeDevFlag = "false".
export iterativeDevFlag
;;
noLogErrorsToConsole)
logErrorsToConsoleFlag = "false".
export logErrorsToConsoleFlag
;;
nopointbase)
POINTBASE_FLAG = "false".
export POINTBASE_FLAG
;;
doExit)
doExitFlag = 'true '.
export doExitFlag
;;
noExit)
doExitFlag = "false".
export doExitFlag
;;
verbose)
verboseLoggingFlag = 'true '.
export verboseLoggingFlag
;;
enableHotswap)
enableHotswapFlag="-javaagent:${WL_HOME}/server/lib/diagnostics-agent.jar".
export enableHotswapFlag
;;
*)
PROXY_SETTINGS = "${PROXY_SETTINGS} $1.
export PROXY_SETTINGS
;;
ESAC
Maj
fact
MEM_DEV_ARGS =""
export MEM_DEV_ARGS
If ["${DOMAIN_PRODUCTION_MODE}" = "true"]; then
PRODUCTION_MODE = "${DOMAIN_PRODUCTION_MODE}".
export PRODUCTION_MODE
FI
If ["${PRODUCTION_MODE}" = "true"]; then
debugFlag = "false".
export debugFlag
testConsoleFlag = "false".
export testConsoleFlag
iterativeDevFlag = "false".
export iterativeDevFlag
logErrorsToConsoleFlag = "false".
export logErrorsToConsoleFlag
FI
# If you want to override the default Patch Classpath, the library path and the path for this area.
# Please uncomment the following lines and add a value valid for environment variables
# define PATCH_CLASSPATH = [myPatchClasspath] (windows)
# define PATCH_LIBPATH = [myPatchLibpath] (windows)
# define PATCH_PATH = [myPatchPath] (windows)
# PATCH_CLASSPATH = [myPatchClasspath] (unix)
# PATCH_LIBPATH = [myPatchLibpath] (unix)
# PATCH_PATH = [myPatchPath] (unix)
. ${WL_HOME}/common/bin/commEnv.sh
WLS_HOME = "${WL_HOME}" / Server ""
export WLS_HOME
If ["${JAVA_VENDOR}" = "Sun"]; then
WLS_MEM_ARGS_64BIT = "- Xms256m - Xmx512m".
export WLS_MEM_ARGS_64BIT
WLS_MEM_ARGS_32BIT = "- Xms256m - Xmx512m".
export WLS_MEM_ARGS_32BIT
on the other
WLS_MEM_ARGS_64BIT = "- Xms512m - Xmx512m".
export WLS_MEM_ARGS_64BIT
WLS_MEM_ARGS_32BIT = "- Xms512m - Xmx512m".
export WLS_MEM_ARGS_32BIT
FI
MEM_ARGS_64BIT = "${WLS_MEM_ARGS_64BIT}".
export MEM_ARGS_64BIT
MEM_ARGS_32BIT = "${WLS_MEM_ARGS_32BIT}".
export MEM_ARGS_32BIT
If ["${JAVA_USE_64BIT}" = "true"]; then
MEM_ARGS = "${MEM_ARGS_64BIT}".
export MEM_ARGS
on the other
MEM_ARGS = "${MEM_ARGS_32BIT}".
export MEM_ARGS
FI
MEM_PERM_SIZE_64BIT = ""-XX:PermSize = 128 m ""
export MEM_PERM_SIZE_64BIT
MEM_PERM_SIZE_32BIT = ""-XX:PermSize = 48 m ""
export MEM_PERM_SIZE_32BIT
If ["${JAVA_USE_64BIT}" = "true"]; then
MEM_PERM_SIZE = "${MEM_PERM_SIZE_64BIT}".
export MEM_PERM_SIZE
on the other
MEM_PERM_SIZE = "${MEM_PERM_SIZE_32BIT}".
export MEM_PERM_SIZE
FI
MEM_MAX_PERM_SIZE_64BIT = ""-XX:MaxPermSize = 256 m ""
export MEM_MAX_PERM_SIZE_64BIT
MEM_MAX_PERM_SIZE_32BIT = ""-XX:MaxPermSize = 128 m ""
export MEM_MAX_PERM_SIZE_32BIT
If ["${JAVA_USE_64BIT}" = "true"]; then
MEM_MAX_PERM_SIZE = "${MEM_MAX_PERM_SIZE_64BIT}".
export MEM_MAX_PERM_SIZE
on the other
MEM_MAX_PERM_SIZE = "${MEM_MAX_PERM_SIZE_32BIT}".
export MEM_MAX_PERM_SIZE
FI
If ["${JAVA_VENDOR}" = "Sun"]; then
If ["${PRODUCTION_MODE}" = ""]; then
MEM_DEV_ARGS = "-XX:CompileThreshold = $8000 {MEM_PERM_SIZE}"
export MEM_DEV_ARGS
FI
FI
# Must have a separate trial here because of the immediate expansion of the variables under windows
If ["${JAVA_VENDOR}" = "Sun"]; then
MEM_ARGS = "${MEM_ARGS} ${MEM_DEV_ARGS} ${MEM_MAX_PERM_SIZE}".
export MEM_ARGS
FI
If ["${JAVA_VENDOR}" = "HP"]; then
MEM_ARGS = "${MEM_ARGS} ${MEM_MAX_PERM_SIZE}".
export MEM_ARGS
FI
If ["${JAVA_VENDOR}" = "Apple"]; then
MEM_ARGS = "${MEM_ARGS} ${MEM_MAX_PERM_SIZE}".
export MEM_ARGS
FI
If ["${JAVA_VENDOR}" = "IBM"]; then
MEM_ARGS = "${MEM_ARGS} ${MEM_MAX_PERM_SIZE}".
export MEM_ARGS
FI
# If the environment variable USER_MEM_ARGS is set, use it to substitute the values of all THE MEM_ARGS
If ["${USER_MEM_ARGS}"! = ""]; then
MEM_ARGS = "${USER_MEM_ARGS}".
export MEM_ARGS
FI
JAVA_PROPERTIES = "-Dplatform.home =, ${WL_HOME} - Dwls.home = ${WLS_HOME} - Dweblogic.home = ${WLS_HOME}"
export JAVA_PROPERTIES
# To use Java authorization contract for containers (JACC) in this area,
# Uncomment the next section please. If there are several machines
# your domain name, make sure to change the setDomainEnv in the area associated with
# each machine.
#
# - Djava.security.manager
# - Djava.security.policy = weblogic.policy rental
# - Djavax.security.jacc.policy.provider = weblogic.security.jacc.simpleprovider.SimpleJACCPolicy
# - Djavax.security.jacc.PolicyConfigurationFactory.provider = weblogic.security.jacc.simpleprovider.PolicyConfigurationFactoryImpl
# - Dweblogic.security.jacc.RoleMapperFactory.provider = weblogic.security.jacc.simpleprovider.RoleMapperFactoryImpl
JAVA_PROPERTIES = "${JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES}".
export JAVA_PROPERTIES
ARDIR = "${WL_HOME} / server/lib '.
export ARDIR
pushd ${LONG_DOMAIN_HOME}
# Clustering support (edit for your cluster!)
If ["${ADMIN_URL}" = ""]; then
# The part then this block tells us we're starting either a server admin OR we are nonclustered
CLUSTER_PROPERTIES = ""-Dweblogic.management.discover = true ' "
export CLUSTER_PROPERTIES
on the other
CLUSTER_PROPERTIES = ' - Dweblogic.management.discover = false - Dweblogic.management.server = ${ADMIN_URL} ".
export CLUSTER_PROPERTIES
FI
If ["${LOG4J_CONFIG_FILE}"! = ""]; then
JAVA_PROPERTIES = "${JAVA_PROPERTIES} - Dlog4j.configuration = file: ${LOG4J_CONFIG_FILE}" "
export JAVA_PROPERTIES
FI
JAVA_PROPERTIES = "${JAVA_PROPERTIES} ${CLUSTER_PROPERTIES}".
export JAVA_PROPERTIES
JAVA_DEBUG =""
export JAVA_DEBUG
If ["${debugFlag}" = "true"]; then
JAVA_DEBUG = "-Xdebug - Xnoagent - Xrunjdwp: transport = dt_socket, address = ${DEBUG_PORT}", server = y, suspend = n - Djava.compiler = NONE ""
export JAVA_DEBUG
JAVA_OPTIONS = "${JAVA_OPTIONS} ${enableHotswapFlag} - ch - da: com.bea-da: Javelin--da: weblogic... -... ea:com.bea.wli - ea:com.bea.broker... - ea:com.bea.sbconsole..." »
Export JAVA_OPTIONS
on the other
JAVA_OPTIONS = "${JAVA_OPTIONS} {enableHotswapFlag} '-da '"
Export JAVA_OPTIONS
FI
If [! d ${JAVA_HOME} / lib]; then
ECHO "the JRE is not found in the directory ${JAVA_HOME}." (JAVA_HOME) »
ECHO "Please change your environment and set the JAVA_HOME.
echo "variable to point to the root directory of your Java installation.
popd
read _val
output
FI
If ["${POINTBASE_FLAG}" = "true"]; then
DATABASE_CLASSPATH = "${POINTBASE_CLASSPATH}".
export DATABASE_CLASSPATH
on the other
DATABASE_CLASSPATH = "${POINTBASE_CLIENT_CLASSPATH}".
export DATABASE_CLASSPATH
FI
If ["${DATABASE_CLASSPATH}"! = ""]; then
If ["${POST_CLASSPATH}"! = ""]; then
POST_CLASSPATH = "${POST_CLASSPATH} ${CLASSPATHSEP} ${DATABASE_CLASSPATH}".
export POST_CLASSPATH
on the other
POST_CLASSPATH = "${DATABASE_CLASSPATH}".
export POST_CLASSPATH
FI
FI
If ["${ARDIR}"! = ""]; then
If ["${POST_CLASSPATH}"! = ""]; then
POST_CLASSPATH = "${POST_CLASSPATH} ${CLASSPATHSEP} ${ARDIR}" / XQRL.jar ' "
export POST_CLASSPATH
on the other
POST_CLASSPATH = "${ARDIR}" / XQRL.jar ' "
export POST_CLASSPATH
FI
FI
# SUPPORT PROFILING
JAVA_PROFILE =""
export JAVA_PROFILE
SERVER_CLASS = "weblogic. Server '.
export SERVER_CLASS
JAVA_PROPERTIES = "${JAVA_PROPERTIES} ${WLP_JAVA_PROPERTIES}".
export JAVA_PROPERTIES
JAVA_OPTIONS = "${JAVA_OPTIONS} {JAVA_PROPERTIES} - Dwlw.iterativeDev = ${iterativeDevFlag} - Dwlw.testConsole = ${testConsoleFlag} - Dwlw.logErrorsToConsole = ${logErrorsToConsoleFlag}" "
Export JAVA_OPTIONS
If ["${DOMAIN_PRODUCTION_MODE}" = "true"]; then
"JAVA_OPTIONS =" - Dweblogic.ProductionModeEnabled = true, ${JAVA_OPTIONS} "
Export JAVA_OPTIONS
FI
#--Propriétés of configuration, so that we can save stdout and stderr to files
If ["${WLS_STDOUT_LOG}"! = ""]; then
echo "Logging WLS stdout to ${WLS_STDOUT_LOG}".
JAVA_OPTIONS = "${JAVA_OPTIONS} - Dweblogic.Stdout = ${WLS_STDOUT_LOG}" "
Export JAVA_OPTIONS
FI
If ["${WLS_STDERR_LOG}"! = ""]; then
echo "Logging WLS stderr to ${WLS_STDERR_LOG}".
JAVA_OPTIONS = "${JAVA_OPTIONS} - Dweblogic.Stderr = ${WLS_STDERR_LOG}" "
Export JAVA_OPTIONS
FI
# ADD EXTENSIONS TO CLASS PATHS
If ["${EXT_PRE_CLASSPATH}"! = ""]; then
If ["${PRE_CLASSPATH}"! = ""]; then
PRE_CLASSPATH = "${EXT_PRE_CLASSPATH} ${CLASSPATHSEP} ${PRE_CLASSPATH}".
export PRE_CLASSPATH
on the other
PRE_CLASSPATH = "${EXT_PRE_CLASSPATH}".
export PRE_CLASSPATH
FI
FI
If ["${EXT_POST_CLASSPATH}"! = ""]; then
If ["${POST_CLASSPATH}"! = ""]; then
POST_CLASSPATH = "${POST_CLASSPATH} ${CLASSPATHSEP} ${EXT_POST_CLASSPATH}".
export POST_CLASSPATH
on the other
POST_CLASSPATH = "${EXT_POST_CLASSPATH}".
export POST_CLASSPATH
FI
FI
If ["${WEBLOGIC_EXTENSION_DIRS}"! = ""]; then
JAVA_OPTIONS = "${JAVA_OPTIONS} - Dweblogic.ext.dirs = ${WEBLOGIC_EXTENSION_DIRS}" "
Export JAVA_OPTIONS
FI
JAVA_OPTIONS = "${JAVA_OPTIONS}"
Export JAVA_OPTIONS
# SET THE CLASSPATH
If ["${WLP_POST_CLASSPATH}"! = ""]; then
If ["${CLASSPATH}"! = ""]; then
CLASSPATH = "${WLP_POST_CLASSPATH} ${CLASSPATHSEP} ${CLASSPATH}.
Export CLASSPATH
on the other
CLASSPATH = "${WLP_POST_CLASSPATH}".
Export CLASSPATH
FI
FI
If ["${POST_CLASSPATH}"! = ""]; then
If ["${CLASSPATH}"! = ""]; then
CLASSPATH = "${POST_CLASSPATH} ${CLASSPATHSEP} ${CLASSPATH}.
Export CLASSPATH
on the other
CLASSPATH = "${POST_CLASSPATH}".
Export CLASSPATH
FI
FI
If ["${WEBLOGIC_CLASSPATH}"! = ""]; then
If ["${CLASSPATH}"! = ""]; then
CLASSPATH = "${WEBLOGIC_CLASSPATH} ${CLASSPATHSEP} ${CLASSPATH}.
Export CLASSPATH
on the other
CLASSPATH = "${WEBLOGIC_CLASSPATH}".
Export CLASSPATH
FI
FI
If ["${PRE_CLASSPATH}"! = ""]; then
CLASSPATH = "${PRE_CLASSPATH} ${CLASSPATHSEP} ${CLASSPATH}.
Export CLASSPATH
FI
If ["${JAVA_VENDOR}"! = "BEA"]; then
JAVA_VM = "${JAVA_VM} ${JAVA_DEBUG} ${JAVA_PROFILE}".
export JAVA_VM
on the other
JAVA_VM = "${JAVA_VM} ${JAVA_DEBUG} ${JAVA_PROFILE}".
export JAVA_VM
FI1, using Sun's JAVA with HP virtual machine? Why not change to the JVM from HP.
2, if you use the JDK from HP:
Add lines to follow in setDomainEnv.sh
GC_LOG="${DOMAIN_HOME}/bin/${server_name}.GC$$.log".
MEM_ARGS = "- Xms1024m - Xmx1024m"
MEM_ARGS = "${MEM_ARGS}"-XX: NewSize = 256 m - XX: MaxNewSize = 256 m - XX: PermSize = 128 m - XX: MaxPermSize = 256 m - XX: SurvivorRatio = 8 ""
MEM_ARGS = "${MEM_ARGS} - Xoptgc - XX: + PrintGCTimeStamps - XX: + PrintGCDetails - Xloggc: ${GC_LOG}" "
MEM_ARGS = "${MEM_ARGS}"-XX: + UseSpinning - XX: + HeapDumpOnOutOfMemoryError - XX: + HeapDumpOnly ""export MEM_ARGS
3, you can use HPjmeter to monitor your server instance. It can help you find the problem quickly and easily.
-
"Garbage collect from."
Hello:
Have we never saw the message "Garbage collect from" on the JDE title bar when Simulator starts up.
It lasted all night.
And I also tried to change the model of simluator, the problem still exists.
Thank you!
Thanks Mark, it works now
-
How different modes of garbage collection?
On http://na.blackberry.com/eng/devjournals/resources/journals/jan_2005/garbage_collection.jsp#programm... there are two modes of GC listed, but only a single API to perform the full pass. Is it possible to run a past further by programming? Thank you!
As I said, the only way that you are able to instruct the JVM garbage collection is through the System.gc method. There is no other way around it - this, I think, is the same thing with J2SE as well.
-
Forcing a garbage collection?
I am currently checking the memory usage of a script, but even after removal of the classes, the use of memory not to let down and even keep it as new instances are created (and then removed). In my view, thit is because even these instances are eligible for garbage collection is not the case because there is no need to release the memory of new instances... How many times garbage collection operation occurs? Is there a way to force garbage collection usign AS3 so I can check if my code is really remove instances?You can use the code below to force a garbage collection. (to end the loop when no loner necessary):
-
How can I determine the size of the files and photo albums?
How can I determine the size of the files and photo albums?
It is not really in any way, nor is it necessary-what you trying to accomplish?
LN
-
Soft pictures for Mac: how to determine the size of the image file
Question: in the Photos for Mac, how can I determine the size of a photo or a video file
Set-up the info panel does not include the size of the file.
Furthermore, I don't see any place where I can do a "show in finder" to find the information in this way.
Thank you!
Can you not with the right button on the image file in the folder, the images are stored in, select "Get Info" and then find the size of the file in this way?
-
Questions about to determine the size of the array of data storage with flexibility
I try to use the CVI function below to load data from .csv file to the table that I was intending to use later:
filereturnvalue = FileSelectPopup ("c:\\Users\\Desktop\\FileDirectory", "*.csv", "", 'Select the data file', VAL_LOAD_BUTTON, 0, 0, 1, 0, LoadFilePath);
FileToArray (DATAArray, VAL_CHAR, LoadFilePath, MaxDataSize, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_ASCII);
For the data table "predetermined", it is quite straightforward, because the size of the table is already set. However, I wonder if there is anyway I could use CVI directly import data and determine the size of the array on the fly? Which means that the user need not know the length of the data, and it could be determined then to import the file.
Hello
for ASCII files, you can do so in any first read the file and counting the newline characters, something like:
int file_handle;
int index;
int size = 0;
char line_buffer [80];If (OpenFile (...) > 0)
{
While (ReadLine (...) > 0)
{
size ++;
}
}
CloseFile(f) (file_handle);This way you can determine the number of rows you have, but you must have an idea of how long a line may be, one number per line or 32000 because you must specify the size of your line_buffer.
In the next step you analyserions monotube for occurrence of your column separator (say a ;) to determine the number of columns (separators found + 1).
-
Determine the size of each Dimension of an array of 2D in TestStand
How can I determine the size of each dimension of an array of 2D in TestStand? myArray.GetNumElements () refers to the TOTAL number of elements in the table (2D) and does not help me. I need to iterate on a single dimension.
Thank you
Andrew
GetUpperBounds are but just not in this context. Try something like the following...
Locals.MyDimensions = Locals.MyArray.Type.ArrayDimensions.GetUpperBounds)
Where Locals.MyArray represents the 2D table you want dimensions of and Locals.MyDimensions is a 1 d array to store the dimensions. Something like...
Locals.MyArray.Type.ArrayDimensions.GetUpperBounds () [0]
... might work as well, this example returns the number of elements in the first dimension of Locals.MyArray.
Kind regards
Steven Zittrower
Technical sales engineer
National Instruments
-
Determine the size of the container when using SizeUnit.PERCENT
Hello
How can I determine the width and height of a container, when I use the percentage of the size of the container?
I have the following code, but this.width and this.height are both 0, causing the background sprite is not to demonstrate:
public class HeaderContainer extends Container { private var _imgCategory:Image = new Image(); private var _lblTitle:Label = new Label(); private var _matrix:Matrix = new Matrix(); private var _sprBackgroundColor:Sprite = new Sprite(); private var _tfmtTitle:TextFormat = new TextFormat(); public function HeaderContainer() { margins = Vector.
([5,5,5,5]); debugColor = 0xCCCCCC; // grey flow = ContainerFlow.HORIZONTAL; align = ContainerAlign.NEAR; size = MyConstants.HEADER_SIZE; sizeUnit = SizeUnit.PERCENT; initializeUI(); } public function initializeUI() : void { with (_sprBackgroundColor) { x = y = 0; graphics.beginFill(0x0000FF, 1); graphics.drawRect(0, 0, this.width, this.height); graphics.endFill(); } ... } Have you tried to call the initializeUI method after the container has been added to the scene? You can easily register a handler to do this.
-
Restarting the device on the garbage collection
Hello
I created an application that performs the following operations:
- Read an email address of a BasicEditField that an end user will be input.
- Convert this string to an object of net.rim.blackberry.api.mail.Address
- Persist the object address by doing a commit sync
- Read the persistent object even to intervals and use it to send email.
I am able to record the e-mail to the PersistentStore address. When I get out my app running (for sending electronic mail timed) so the device restarts. After a reboot, the device remains stable and emails come out because they are supposed to.
I am now able to reproduce this exact behavior if I first enter the e-mail address, it persists and call a GC (garbage collection). As soon as I do this, the device restarts. As a tip, I also did a forceCommit() rather than a commit() and there is no difference.
I tested the following physical devices:
Bold 9700 - v5.0.0.862 (1446 Bundle, platform 5.1.0.175)
Torch 9800 - v6.0.0.246 (695 Bundle, platform 6.4.0.150)
The same behavior is exhibited in both devices.
I don't think any of you have already encountered this? I was not able to understand why this is happening and it has been driving me crazy. If you've seen behavior like this and have either thought about it or not, please answer. Thank you!
Imagine that... Address is not persistent. Could have fooled me because once or twice, the program worked by reading the object address of is. The behavior seems to be inconsistent. I have changed my address object in a string and now everything works fine.
-
How to determine the size of the file and the pixel of an image?
How to determine the size of the file and the pixel of an image?
1 MB is 2 ^ 20 bytes. It is easy to represent long:
final long MegaByte = 1048576L; //1048576 is 2^20 and L denotes that this is a long if(fileConn.fileSize() > MegaByte) { do something here }
-
How to determine the size of the screen
Is there a way in OS Version 4.3.0 to determine when executing what the resolution of the screen of the device on which the application is running?
Thanks for the help.
Take a look at the net.rim.device.api.ui.Graphics class
To determine the size of the screen use the static methods:
Graphics.getScreenWidth ();
Graphics.getScreenHeight ();
To determine the resolution of the screen in pixels per meter (PPM), use the following static methods:
Graphics.getScreenHorizontalResolution ();
Graphics.getScreenVerticalResolution ();
-
Determine the size of the component during execution
I am trying to build a component Paginagion of size fixed. The number of pages which means that the size of the paging is fixed, however depending on the content may vary. Most do not specify how much is displayed on a single page.
The idea is to use the text as input and push as much as can be displayed on the page. Factors having an influence here is the fonts and formatting.
To determine the page which you should see that I need to understand the amount of text that can be displayed. To do this, I need to know the size of the element that contains the text (think label). The size of the label is however only determined after that is layouted. So here's what I could do:
@Override public void start(Stage primaryStage) { Label lbl = new Label("uitroweigudfgf jkfhgklfsjghslkghs kflgskjgh"); System.out.println(lbl.getWidth()+","+lbl.getHeight()); lbl.widthProperty().addListener(new ChangeListener<Number>(){ @Override public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) { System.out.println(lbl.getWidth()+","+lbl.getHeight()); } }); lbl.heightProperty().addListener(new ChangeListener<Number>(){ @Override public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) { System.out.println(lbl.getWidth()+","+lbl.getHeight()); } }); StackPane root = new StackPane(); root.getChildren().add(lbl); Scene scene = new Scene(root, 300, 250); primaryStage.setTitle("Hello World!"); primaryStage.setScene(scene); primaryStage.show(); }
After the third change, I have the dimensions of the label. With this method, I would have to push all of the text in labels to figure out what can be displayed.
Is there a better way to do it?
My basic problem was with the size of the labels. Try to find a solution I had a look at LabelSkinBase which uses the Utils class in the same package. This class provides methods (although private package) to calculate the size of the text that results from:
static Text helper = new Text(); static double computeTextWidth(Font font, String text, double wrappingWidth) { helper.setText(text); helper.setFont(font); // Note that the wrapping width needs to be set to zero before // getting the text's real preferred width. helper.setWrappingWidth(0); helper.setLineSpacing(0); double w = Math.min(helper.prefWidth(-1), wrappingWidth); helper.setWrappingWidth((int)Math.ceil(w)); return Math.ceil(helper.getLayoutBounds().getWidth()); } static double computeTextHeight(Font font, String text, double wrappingWidth) { return computeTextHeight(font, text, wrappingWidth, 0); } static double computeTextHeight(Font font, String text, double wrappingWidth, double lineSpacing) { helper.setText(text); helper.setFont(font); helper.setWrappingWidth((int)wrappingWidth); helper.setLineSpacing((int)lineSpacing); return helper.getLayoutBounds().getHeight(); } static int computeTruncationIndex(Font font, String text, double width) { helper.setText(text); helper.setFont(font); helper.setWrappingWidth(0); helper.setLineSpacing(0); // The -2 is a fudge to make sure the result more often matches // what we get from using computeTextWidth instead. It's not yet // clear what causes the small discrepancies. Bounds bounds = helper.getLayoutBounds(); Point2D endPoint = new Point2D(width - 2, bounds.getMinY() + bounds.getHeight() / 2); return helper.impl_hitTestChar(endPoint).getCharIndex(); }
With that, I am able to determine the amount of text can be put into the label, without the chain of ellipsis appears.
Maybe you are looking for
-
Why not list of saved password obfuscated or even behind an admin password prompt?
I think that it is unacceptable that in 2015 I could still harvest the average user usernames and passwords by simply asking to use their browser for a few minutes. Edit > Preferences > saved passwords... must be behind a password, rather than being
-
Spectrum of HP x 360-13-4005dx: screen flashing power on the new HP spectrum x 360-13-4005dx
I just got a new spectrum HP x 360-13-4005dx and it works fine EXCEPT that the back of ordinary black for a moment screen and then flashes back on. Usually black for a split second - maybe one or two seconds maximum. EXTREMELY FRUSTRATING. I went thr
-
Since the upgrade to iOS 9.0.1 or later I couldn't get iCloud to work properly. For example, I can use is no longer Apple pay. Whenever I have it try appears saying that I need to login to iCloud. I try and it fails (Yes, the password is right). In a
-
Hi my name is sonny and I installed halo 2 and now it won't let not uninstall me IT... I'm looking for the file under search that says uninstall halo 2 and nothing comes up, but all the files for the game Halo. Help, please!...
-
Thunking spooler APIs from 32 to 64 process has stopped working
I get this error, Thunking spooler APIs from 32 to 64 process ceased to function, that when I try to print my bank statement which is in the format pdf from my Bank Web site. Otherwise I am able to print from other applications, including Microsoft O