Unsatisfied with PhpStorm

I'm a long time PhpStorm user and I still think it is one of the best PHP IDEs available.

However, since a while I'm getting more and more unsatisfied as I mainly work in 32bit Virtual Machines, which means they are limited to 4GB RAM maximum.

I'm working on differently sized projects based on either WordPress, Zend or CodeIgniter. During my work time, I only have PhpStorm, Firefox or Chrome and an instance of TotalCommander open on the VM. And unfortunately PhpStorm turns out to be a real memory hog, slowing down the whole VM, often to a degree where I need to restart it to be able to keep working "smoothly" without having to wait so often for Windows finishing its memory swapping with the Page File.

When I (re)start Windows and the IDE, it runs at about 200-300 MB memory. But during some hours it then grows up to 800-900MB memory usage, even though I'm not adding files to the project, but mainly work on the same 4-5 different PHP, CSS and JS files on and off. For instance while writing this post, PhpStorm has grown its memory usage from 648MB to 712MB even though I didn't touch it.

You could say: Then use 64bit VMs! And while you might be right, this creates yet another problem, because if you give 8GB or more RAM to a VM, this means they are instantly missing from your Host OS, which then creates a memory sink on the Host OS and will cause the same swapping and performance problem, especially if you run 2-3 VMs at the same time.

I really hope to see PhpStorm becoming more "lightweight" in some future releases and that you guys might address the memory usage of your otherwise wonderful IDE. :)

Thanks.

0
Avatar
Permanently deleted user

Hello,

Do you run PhpStorm inside the VM? What is the usecase for this?

0
Avatar
Permanently deleted user

Hello Vladimir,

I'm a full time software developer and the usecase is that I can have completely separated workspaces for different tasks, which don't interfere with the Host OS and are not depended on it.

I'm using different VMs for different projects. I have a Web Development VM, which runs PhpStorm, Apache, MySQL. Then I have a Software Development OS, which runs Delphi or Visual Studio, etc.

Also it doesn't matter if I need to update or reinstall the Host OS (Windows 7 -> Windows 10 for instance), it will never touch the Guest OS in the VM. Other advantages are portability and OS independency. I can use the same VM on different computers and on different OS (Windows, Mac, ...). Also security, backup, reliability, etc.

So therefore for me it is very important that an IDE is "lightweight". For instance I work on and maintain some big projects in Delphi with like 500k lines of code and ~10MB code size, different libraries, etc. And I never have to restart the IDE or the VM, because Delphi doesn't eat up all the memory. The uptime of the Software Dev VM is 11 days and 5 hours now and Delphi consumes ~500MB of memory, even though I heavily use it.

But the WebDev VM, I have to restart it every day because PhpStorm consumes up to 800-900MB memory and makes it hard to maintain a continuous "workflow". But over the last days I found out that it is enough if I just close PhpStorm every now and then and restart it to keep it at a small memory footprint. And I don't notice any advantages in reaction time, speed or anything, whether PhpStorm is at 300MB or 900MB memory. The only difference I notice is that at ~900MB the whole VM keeps getting slower and slower and even Alt+Tabbing inside the VM is getting more and more painful during that.

Don't get me wrong, I really love to work with PhpStorm and from my experiences with other PHP IDEs, I think it is one of the best around. But I really look forward to see it more "lightweight".

Best

Mario

0

Hey Mario,

IMHO the solution to your problem is to contain the environments with Vagrantfile definitions but still use the host for the IDE.

This is how I use it (and most developers do current days). As a reference I may use about 50 different projects. Each with its own configuration. They do NOT interfere, they can even use different PHP versions, different frameworks, or even different languages. One may have apache, the other do not have a web server and another may have a mysql whilst another does not.

Here's how I do it:

  • In my host, install my IDEs (for example PhpStorm and others). JetBrain's Toolbox makes it really easy and fast. They can co-exist with Unity3D or VisualStudio or whatever.
  • I choose a reference directory where to create and destroy your projects. If the host is windows, I use the Documents folder and I create a "repos" folder in it. If the host is linux I just create a "repos" directory in my home.
  • In the repos dir, I just clone the project I'm going to work
  • I issue the command "vagrant up" and wait for the machine to be provisioned.
  • I open from the host IDE the folder to work with. I use code-names for all. For example I'm currently having 5 PhpStorms with 5 projects open at the same time. At repos/tighten-violet, repos/housewares-probate, repos/dislodge-galvanize, repos/genetics-imbalance and repos/carping-resupply
  • I just do "vagrant ssh" into the machine I want to run things manually, like running unit-tests (although I'm really willing to configure the remote interpreter).
  • When I finish, I do "vagrant halt" if I feel I'll go back to that repo soon or "vagrant destroy" if I feel I dont.

Then... in the repo, appart from committing the Vagrantfile, which allows me to completely delete the virtual machine and just "clone and launch" in ANY other host machine, I also commit *some* .idea files. Here's where I get what to put in the .gitignore: https://www.gitignore.io/api/phpstorm

With this, you can:

  1. Re-use your complete VM in ANY host.
  2. Your VMs do NOT allocate gigas of space, just text definition of them (Vagrantfile).
  3. In the VM you can work from the inside AND the outside at the same time (vagrant shared folder).
  4. Typical use is to "run the software inside the VM" but still EDIT the source code from the outside.
  5. In the event you need different settings in your IDE for different projects (for example different code-style configs for different projects), the .idea directory will handle that for you. As an example I heavily use the definition of what directories are (tests, source, etc) and that is even shared with other developers via the git repo.
  6. Maintain different VM configurations for different projects (one project may have MySQL and Apache with PHP 7.0, the other Apache alone with PHP whatever-version without MySql at all, etc).

I strongly suggest you consider defining your execution environments in a Vagrantfile and edit from the outside, still storing the different PhpStorm configs _in_ the project dirs.

I'm used to Vagrant but I think docker heavy users would say the same: Contain the environments in docker definition files and edit from the outside.

0

请先登录再写评论。