SqlPackage.Exe Out of Memory

JM 1 Reputation point


I am using the 160 version of SqlPackage to publish a dacpac to an Azure Sql DB. The dacpac itself has a very small model of around 10 tables but the post deploy step inserts roughly 1M rows.

What i am noticing is when run the SqlPackage.exe process consumes memory until an out of memory exception occurs. ~6GB

In doing some research I tried to add /p:Storage:File however this did not make any difference.

Even if I increase the memory of the machine whilst I don't get an memory exception the sqlpackge.exe seems to never end.

Is there advise on how to break up a dacpac or deal with large post deploy scripts?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,324 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YufeiShao-msft 7,081 Reputation points

    Hi @JM ,

    Sqlpackage can use considerable resources when building the database model for large databases, it depends on the meta data within the dacpac and the structure of the model within the solution, the schema model is compiled in memory, for large database schemas the memory requirement on the client machine running Sqlpackage.exe may be significant, you can try to use composite database especially when managing databases with partitioned tables, or you can try to specify an alternative temporary directory with the property


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.