Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 259072 bytes) - google-app-engine

what is this error mean and how do i over come this?
am getting this error when i run my joomla using Google App Engine. thanks in advance.

Your PHP configuration at the server has a memory limit , which is rather low.
I'd recommend to set it to 32 Mb.
I solve it, by writing down a line in "configuration.php" and "configuration.php-dist":
ini_mem('memory_limit','12M');
For unlimited memory usage of server
ini_set('memory_limit', '-1');

Related

How to avoid java.lang OutOfMemory error in Jmeter?

I have been trying to run 50 users in Jmeter, but I see Java.Lang OutOfMemory error in the command prompt once the number of users crosses 35. My machine has a physical memory of 16GB and in-spite of increasing the heap size to 8GB(8192m) in the jmeter.bat file, I still happen to see the same error. I have also disabled the listeners to reduce the memory consumption as well and I used the below heap commands to increase its size.
set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=8192m
I also used a few more alternative commands to increase the heap size which are:
set HEAP="-Xms2g -Xmx2g -X:MaxMetaspaceSize=512m" && jmeter.bat
HEAP="-Xms512m -Xmx4096m"
But I happen a see another error stating
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
errorlevel=1
Can anybody help me in resolving this issue for running a test with 50 users successfully?
Make sure that you have 64-bit Java installation, you won't be able to allocate more than 2 gigabytes to 32-bit JVM
Make sure to use proper syntax as you made a typo and it doesn't looks like you know what you're really doing (setting too high metaspace size will rather cause the problems than fix them):
OutOfMemoryError Exception can have many faces, it's not necessarily connected with insufficient heap, read the stacktrace and eventual .hprof file more attentively
Make sure to follow recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article

Getting error for increasing the Weblogic 10.3.6 heap size to 4 GB

I am using Web logic 10.3.6 and Java 1.7.
My application is running out memory if keep heap space Xmx512m and Web logic is not able to acquire enough memory space when in am increasing to Xmx2048m.
First I have tried with WLS_MEM_ARGS_32BIT=-Xms256m -Xmx512m
For this my application is going out of memory at the server start up giving below error in console:
<Jan 26, 2019 4:42:55 PM EST> <Error> <HTTP> <BEA-101216> <Servlet: "InitializerServlet" failed to preload on startup in Web application: "myApp.war".
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuffer.append(StringBuffer.java:237)
Truncated. see log file for complete stacktrace
>
<Jan 26, 2019 4:42:55 PM EST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application '_appsdir_myApp_war'.
weblogic.application.ModuleException: [HTTP:101216]Servlet: "InitializerServlet" failed to preload on startup in Web application: "CUEPrepAndRating.war".
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuffer.append(StringBuffer.java:237)
the server doesn't start if I increase the heap space to set WLS_MEM_ARGS_32BIT=-Xms256m -Xmx2048m
and give below error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Can you some one help how I can increase my web logic heap space enough(4GB) so that my application will run without the going out of memory.
You can't. At least not with a 32-bit JDK. See: Maximum Java heap size of a 32-bit JVM on a 64-bit OS - you will not get higher than -Xmx1600m.

Overriding heap memory configuration in Cloud foundry Application

I am using below parameters to override my heap config for JVM -
JBP_CONFIG_OPEN_JDK_JRE: '[memory_calculator: {memory_heuristics: {heap: 65, metaspace: 20}}]'
But I am not able to see the changes getting reflected. Can someone help?
The options you're using only apply for version 3.x of the Java buildpack.
Starting with Java buildpack 4, all you need to do is to set JAVA_OPTS with your JVM configuration options. So if you want to override the max heap size and change the thread stack size, you can do cf set-env my-app JAVA_OPTS '-Xmx100m -Xss228k'.
The Java buildpack will read these values and attempt to adjust the other areas of memory used by the JVM so that it can accommodate running your app within the defined memory limit. If it cannot do that, the Java buildpack will print an error telling you this.
For example, if you set the memory limit to 512M and you set a max heap of 500M, that's not going to work. There won't be enough memory left for other areas of the JVM and the JBP will reject your settings. This is a safety check so to keep your application from exceeding the memory limit and crashing at some point in the future.

Memory usage profiled in task manager and memory profiler tools

.Net winform application.
I used several memory profiler, including CLR profiler, DotTrace memory, Net memory profiler.
The tools gave the result that the allocated memory was 38-40M. But I found that working set was 300-400M in task manager(almost the same size as Peak working set or memory or commit size.
So what's the difference between the two results? What do the results mean?
those tools may show you private bytes or managed heap size, this does not include, e.g. memory mapped file, either page file backed or disk file backed, your app may be r/w ing
big mapped file, so working set looks big, or your app just load too many dll/assemblies.
VMMAP (from sysinternals) can give a clear overview of memory type/size in your app.

OutOfMemoryError trying to upload to Blobstore locally

I am trying to set up a basic file upload to blobstore, but I get
this OutOfMemoryError:
WARNING: Error for /_ah/upload/
aghvbWdkcmVzc3IcCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGMACDA
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
at
javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:
316)
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:186)
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
at
com.google.appengine.api.blobstore.dev.UploadBlobServlet.handleUpload(UploadBlobServlet.java:
135)
at com.google.appengine.api.blobstore.dev.UploadBlobServlet.access
$000(UploadBlobServlet.java:72)
at com.google.appengine.api.blobstore.dev.UploadBlobServlet
$1.run(UploadBlobServlet.java:100)
at java.security.AccessController.doPrivileged(Native Method)
at
com.google.appengine.api.blobstore.dev.UploadBlobServlet.doPost(UploadBlobServlet.java:
98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511);
I used the Memory Analyzer on Eclipse and it said that the memory leak
suspect is QueuedThreadPool. I found this information about a memory
leak bug:
http://jira.codehaus.org/browse/JETTY-1188
Has anyone else had this issue?
Thanks,
Jean
In case anyone comes across this, it's most likely the problem is actually caused by a missing 'name' attribute on the file input field.
See: Uploading to Blobstore gives a Java heap OutOfMemoryError
You should be able to upload files of any size once this is resolved.
It's likely that the development server keeps the file in memory while it's being uploaded and processed. This is not the case on the production server.
How big is the file you're testing with? The simplest solution is to test with smaller files.
I get it with any file size on the dev server.

Resources