Saturday, 19 December 2015

Android Studio JVM Error

Error:  android studio was unable to find a valid JVM

Fix:

  •    Go to Applications->Android Studio
  •    Right click and choose Show Package Contents
  •    Open Info.plist
  •    Change the key JVMversion to 1.7* or 1.8* ( depends on which jdk is installed in your mac )

Sunday, 22 November 2015

setColor cocos2dx compile error

Error: setColor cocos2dx compile error

Fix:

  ccColor3B c3 = { 0, 0, 0 };
  selectedImage->setColor(c3);

Saturday, 14 November 2015

syntax error: unknown user in statoverride file

Fix:    sudo sed -i '/<user>/d' /var/lib/dpkg/statoverride

Note: Replace <user> with your real userID

installation error: install_failed_media_unavailable

Fix:    Make sure that you have enough space in your device

Friday, 6 November 2015

Turn ON MySql Event Scheduler feature

By default MySql event scheduler settings are turned OFF. Execute the below commands to turn ON event scheduling in MySql

show variables where variable_name='event_scheduler';

+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | OFF   |
+-----------------+-------+


SET GLOBAL event_scheduler = ON;


show variables where variable_name='event_scheduler';

+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | ON    |
+-----------------+-------+


Monday, 19 October 2015

How to find and kill a process that is using a particular port in ubuntu

1) sudo netstat -lpn |grep :8080
    
      and press Enter

      You can see the PID that occupied the port 8080

2) sudo kill -9 xxxx

      Now you can use the port 8080 for some other application

Memory constraints and limitations of Virtual Private Server

Before you decide to go for Virtual Private Server( VPS ), make your requirements very clear and know the memory limitations of VPS. Long time back I purchased a VPS and I was able to install MySql, Glassfish, Nginx, mail server, puppetmaster and client, memcached, git, etc. Later on I was trying to improve the performance of Glassfish cluster instances and Mysql.
I was able to make changes in memory settings MySql and optimized its performance and tested with mysqltuner. No problem!
Since I had two glassfish cluster instances running on the same machine, I thought of increasing JVM heap size of both instances to 5G. Earlier I had allocated only 2G and I was trying to push this to 5G for both instances.
After making changes in cluster xml, I started 1st instance and it was successful. Instance one was ready to serve requests.
When I try to start the 2nd instance, BOOOOOM!, 2nd instance throws "Out Of Memory Exception", Couldn't reserve enough space for JVM.

Then I checked the available memory in my machine using "free -g". It displayed like this 17G free available memory and only 3G occupied.

What does that mean? 17GB still left but unable to allocate.

Then I spoke to my hosting provider guys and I have been told that it doesn't work the way you think.

This command:
       "cat /proc/user_beancounters" 


You have to investigate the output of the above command to understand why it couldn't allocate 5G to second instance.

Look for this row:
       privvmpages
Check for limit column. That number is the maximum limit that can be allocated to any application. In my case, it was just about 5G. Thats it!
They will not allow you to edit and increase this limit. You have to go for either large vps or a dedicated server to allocate more memory.