We propose a static analysis technique that computes upper bounds of virtual machine usages in a concurrent language with explicit acquire and release operations of virtual machines. In our language it is possible to delegate other (ad-hoc or third party) codes to release virtual machines (by passing them as arguments of invocations). Our technique is modular and consists of (i) a type system associating programs with behavioural types that records relevant informations for resource usage (creations, releases, and concurrent operations), (ii) a translation function that takes behavioral types and return cost equations, and (iii) an automatic solver for the the cost equations. We have experimentally evaluated our technique using a cost analysis solver and we report some results. The technique in this paper may be also applied to estimate (heap) memory consumptions in object-oriented languages.