Eclipse Memory Analyzer: Unable to attach to 32-bit process - memory

when trying to acquire a Heapdump of my eclispe rcp application with the Java Memory Analayzer I get the following error message:
Error creating heap dump. jmap exit code = 1
4120: Unable to attach to 32-bit process running under WOW64
The -F option can be used when the target process is not responding
OS: 64bit Windows7
Java Memory Analyzer: 64bit
Application: 32bit
I tried the 32 and the 64 bit variation and got the same error.
Cans oemone tell me what the problem is?

This means that the jmap you are using is the one that is bundled with the 64 bit version of the JDK. If you are using this jmap to acquire a heap dump from a 32 bit JVM, then this error pops up.
Solution : Use the version of jmap that is bundled with the 32 bit JDK.

Let's say you have Java 64 bit version(so is for Java tools like jvisualvm and jstack) and the IDE/path, where ever you run javac command have java 32 bit in class path, then you will see such issues.
if you try to analyze this process from
1)java VisualVM, then it may not load your process properly, means you will not able to take thread/heap dumps for problematic process.
2) from jstack , then also it will create same problem like you mentioned above.
To solve the issue,make sure that everything is matched in the version.

Related

Delphi compile error F2048 Bad unit format

I ran into an obscure error and am posting the solution here in the hope that it will help someone else having the same problem.
I am writing a Continuous Integration (CI) program using Delphi XE4 to ensure that a set of pascal source files will compile under older versions of Delphi. This CI program runs a series of batch files each running the command line compiler of an older Delphi version. The batch file running the XE compiler produced the following error:
F2048 Bad unit format: 'c:\program files (x86)\embarcadero\rad studio\11.0\lib\Win32\release\System.dcu' - Expected version: 22.0 ... Found version: 25.0
Note that the expected and found versions are different (in this case XE and XE4). Several people have reported similar errors where the expected and found versions were the same - this is usually a mixup between 32 and 64 bit DCUs, but that wasn't the problem here.
This problem only occurs when the CI program is run from within the Delphi XE4 IDE. If the CI program is run outside of the IDE it works fine.
The XE4 IDE adds several environment variables that are inherited by the program being debugged (in this case CI) that are in turn inherited by the batch files. One of these extra environment variables confuses the XE compiler when run in the batch file. The culprit is the added BDSLIB environment variable that points to the XE4 lib directory.
The solution was to simply add
set BDSLIB=
to the beginning of each of batch files. Once this change was made the CI program runs successfully both inside and outside the IDE.

How get Netbeans 7.2 to use 32 Bit JVM

So I am using Netbeans to develop a Jenkins Groovy Post Build Script.
Jenkins runs in 32 bit mode (Production cannot touch), Netbeans wants to run in 64 bit mode.
I can get EITHER environment to work, the problem is that I need to keep switching my PATH variable so the right version of a DLL is on the path, but switch is time consuming and annoying.
I am trying to figure out how to get Netbeans to either run in 32 bit mode or to change the PATH variable in Netbeans to use the 64 Bit DLL (something Visual Studio supports).
So far, nothing I've done has convinced Netbeans to use 32 mode and I see no way to change the path for the Netbeans IDE.
Suggestions?
So I never did get -D to work properly. The values provided there just didn't seem to be reflected in the environment like I would have thought.
My eventual solution was to create a small *.BAT file that doctors the PATH before starting Netbeans. I would LOVE for someone to offer a better solution.
SET PATH=%PATH:enu\auth\x86=enu\auth\x64%
cd /d "C:\Program Files\NetBeans 7.2"
start "NetBeans with PATH Override" "C:\Program Files\NetBeans 7.2\bin\netbeans64.exe" --console suppress

Resolving Address Space is already occupied error using Cygwin and Ruby

I keep getting the same type of error messages and I have really done all I can to get rid of them. The message is as follows, only the module can vary at times:
ruby 5740 child_info_fork::abort: address space needed by 'date_core.so' (0x600000) is already occupied
These messages occur at various times when trying to run Rails, such as “rails console”.
I am running the following environment:
Windows 7 Ultimate 64-bit
Cygwin Net using setup 2.774 (installed from Internet mirrors)
Ruby 1.9.3p392
Rails 3.2.11
I have taken the following steps attempting to fix this:
Deleted all BLODA and restarted, including Norton 360 and Malwarebytes. (BLODA is Big List of Dodgy Apps.)
Deleted and reinstalled Cygwin.
Executed “rvm implode” and rebuilt the RVM and Ruby on Rails environment.
Used CMD & ASH to run “peflagsall” & “rebaseall”. Ran “rubyrebase”. Restarted.
Used FIND to build a file of all *.so & *.dll files. Ran “rebase -T”. Restarted. This has also been done using the “-b 0x77000000” switch.
Used same file to create “to_peflags” script issuing peflags against each individual file. Restarted.
All repair attempts have been futile. At times, “rebase -si |grep ‘*’” would be clean. Any attempt to run “rails console” or similar commands results in Address Space Occupied messages. Subsequent “rebase -si” would then again show conflicts.
I have been trying to run “peflags” against the Ruby modules, but I only get “skipped because could not open” error messages there. File permissions and ACL both show correct permissions. The same error occurs whether or not Administrator is used.
This is pretty frustrating. I would like to fix my current environment, but I am considering moving to MSYS or SFU, but I don’t know if either of those are decent options. I am also considering going native UNIX, but I’ll leap off the cliff when I get to it.
For now, does anyone have a fix for this specific error for me? Thanks…
I have used procexp to monitor "rails console" execution. Bash is calling cmd.exe to run the rails.bat file. Cmd.exe runs in ASLR mode. Used Microsoft EMET 3.0 to turn off mandatory ASLR and bottom up ASLR for both bash and cmd. Cmd.exe still runs in ASLR mode. It must be compiled that way.
Updated registry to set HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\MoveImages to 0, -1 then 1. 0 caused system problems. -1 had no effect. 1, which was supposed to be the default, helped somewhat as long as EMET changes were in place. But, it was unreliable as Address Space Occupied would eventually recur.
Decided to attempt to install a command processor that either didn’t require ASLR or allowed me to disable it using PE flags. I installed TCC/LE and attempted to get Cygwin Bash to use it to process .bat files. I tried using the path variable, the COMSPEC variable and changes to batfile and cmdfile in the registry all to no effect. Cygwin Bash must either have it hard coded or some nonobvious control.
My fix is to replace my environment. I know I will eventually migrate to some Unix, but for now I am converting to MinGW/MSYS and RubyStack. All I want to do is to get a stable RoR (Ruby on Rails) environment running for today. I don’t see that happening using Cygwin with Windows 7 Ultimate. I keep running into too many problems and this one is a very, very tough nut to crack. Thanks…

Rails Elastic Search Error "The stack size specified is too small, Specify at least 160k Error: Could not create the Java Virtual Machine. "

I'm working on a Rails3 Project using Elasticsearch and Tire. After installing Elastic-search when I try to run it, it gives me the following error:
The stack size specified is too small, Specify at least 160k
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I have Java 7 and my OS is Ubuntu 12.04. How do I resolve this error?
Do I need to install Java 6, and if so, how do I do that?
Had the same problem with an older version of elasticsearch (0.19.0).
Installed 0.19.8 and it works again.
You can get it here: elasticsearch-0.19.2.tar.gz
good luck!
Indeed there seems a problem with java 1.7 and older versions of es.
Or you can send the stack size option and set it to something greater then 160k when starting elasticsearch on the console
sudo ./bin/elasticsearch -Xss194k
Increase the stack size to an amount greater than 160k.
Edit file elasticsearch-0.xx.x/bin/elasticsearch.in.sh at about line 34 and increase -Xss to something larger such as -Xss256k for example.
# reduce the per-thread stack size
JAVA_OPTS="$JAVA_OPTS -Xss256k"

Delphi 2009 command line compiler using dcc32.cfg?

In Delphi 2009, how can I build a project using command line. I tried using the command line compiler and supplying -a -u -i -r in dcc32.cfg file. But compiler is not recognizing the paths and throwing the error required package xyzPack is not found.
-aWinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE
-u"C:\MyProj\Output\DCP"
-i"C:\MyProj\Output\DCP"
-r"C:\MyProj\Output\DCP"
and on command line i execute the command :
dcc32 "C:\MyProj\MyProject.dpr" -B -E"c:\MyProj\Output\EXE"
What am I doing wrong here?
Thanks & Regards,
Pavan.
Instead of invoking the compiler directly, consider using MSBuild on your .dproj, since that's what the IDE uses. Delphi MSBuild Build Configurations From Command Line might help you with that.
From the related answer (as shown below) ie:
Compiling with Delphi 2009 from a command line under Windows Vista 64-bit
I notice that you should be able to build a single package from the command line this way. I have used batch files (buildall.cmd) to launch dcc32, and have not yet used msbuild.
I have ultimately found both approaches frustrating, and have instead decided to opt for building a little GUI shell (a lite version of Final Builder, if you like) that basically works as a semi-graphical semi-command-line way of automating my builds and filtering the compiler output to produce results. I would be highly interested in anyone else's experiences with "tinder box" (daily or even continuous build) operations with Delphi.
You may end up where I'm heading... just buy Final Builder. :-)

Resources